Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * Model class for a WordPress theme or plugin. * * @author Mike Ems * @..
Decoded Output download
<?php
/**
* Model class for a WordPress theme or plugin.
*
* @author Mike Ems
* @package Mvied
*/
class Mvied_Model {
protected $_post;
public $ID;
public $name;
public function __construct( $id ) {
if ( ! isset($id) ) {
return $this;
}
$this->_post = get_post($id);
$this->ID = $this->_post->ID;
$this->name = $this->_post->post_title;
$reflect = new ReflectionClass($this);
$properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach($properties as $property) {
$property = $property->getName();
if ( !isset($this->$property) ) {
$this->$property = get_post_meta($this->ID, $property, true);
}
}
}
public function __get( $property ) {
return get_post_meta($this->ID, $property, true);
}
public function getPost() {
return $this->_post;
}
public function load( $array = array() ) {
foreach($array as $key => $value) {
if ( property_exists($this, $key) ) {
$this->$key = $value;
}
}
}
public function save() {
$reflect = new ReflectionClass($this);
$properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach($properties as $property) {
$property = $property->getName();
if ( strpos($property, '_') !== 0 ) {
update_post_meta($this->_post->ID, $property, $this->$property);
}
}
}
} ?>
Did this file decode correctly?
Original Code
<?php
/**
* Model class for a WordPress theme or plugin.
*
* @author Mike Ems
* @package Mvied
*/
class Mvied_Model {
protected $_post;
public $ID;
public $name;
public function __construct( $id ) {
if ( ! isset($id) ) {
return $this;
}
$this->_post = get_post($id);
$this->ID = $this->_post->ID;
$this->name = $this->_post->post_title;
$reflect = new ReflectionClass($this);
$properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach($properties as $property) {
$property = $property->getName();
if ( !isset($this->$property) ) {
$this->$property = get_post_meta($this->ID, $property, true);
}
}
}
public function __get( $property ) {
return get_post_meta($this->ID, $property, true);
}
public function getPost() {
return $this->_post;
}
public function load( $array = array() ) {
foreach($array as $key => $value) {
if ( property_exists($this, $key) ) {
$this->$key = $value;
}
}
}
public function save() {
$reflect = new ReflectionClass($this);
$properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach($properties as $property) {
$property = $property->getName();
if ( strpos($property, '_') !== 0 ) {
update_post_meta($this->_post->ID, $property, $this->$property);
}
}
}
}
Function Calls
None |
Stats
MD5 | 4dd5f990d0a4b1b37b8494c2aa8369ab |
Eval Count | 0 |
Decode Time | 80 ms |