PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.3.9
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.3.9
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
← All changes | classes/core.php +10 -3 0.3.60.3.9 View file →
@@ -12,8 +12,9 @@
12 12 public $is_rest = false;
13 13 public $is_cli = false;
14 14 public $site_url = null;
15 15 public $mwcode = null;
16 + public $licenser = null;
16 17
17 18 private $option_name = 'mwcode_options';
18 19
19 20 public function __construct() {
@@ -37,8 +38,13 @@
37 38 add_action( 'plugins_loaded', array( $this, 'init' ) );
38 39 }
39 40
40 41 function init() {
42 + // Initialize the licenser for Pro version
43 + if ( class_exists( 'MeowCommonPro_Licenser' ) ) {
44 + $this->licenser = new MeowCommonPro_Licenser( MWCODE_PREFIX, MWCODE_ENTRY, MWCODE_DOMAIN, MWCODE_ITEM_ID, MWCODE_VERSION );
45 + }
46 +
41 47 // Part of the core, settings and stuff
42 48 $this->admin = new Meow_MWCODE_Admin( $this );
43 49
44 50 // Only for REST
@@ -279,10 +285,10 @@
279 285 $value = array_map( 'trim', $value );
280 286 }
281 287
282 288 if ( $type === 'array' ) {
283 - $value = json_encode( $value );
284 - $value = str_replace( '\\', '', $value );
289 + // Convert to PHP array format instead of JSON
290 + $value = var_export( $value, true );
285 291 }
286 292
287 293 return [ $name, $value ];
288 294 }
@@ -435,13 +441,14 @@
435 441 if ( $index < count( $params['args'] ) - 1 ) {
436 442 $params['code'] .= ', ';
437 443 }
438 444 }
445 +
439 446 $params['code'] .= ");\necho print_r(\$mwcode_result, true);";
440 447
441 448 $error = null;
442 449 $output = null;
443 -
450 +
444 451 try {
445 452 ob_start();
446 453 eval( $params['code'] );
447 454 $output = ob_get_clean();