Plugin Directory

Changeset 3320257


Ignore:
Timestamp:
06/30/2025 10:06:45 PM (9 months ago)
Author:
Genoo
Message:

Release $SOURCE_TAG

Location:
wpmktgengine/trunk
Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • wpmktgengine/trunk/libs/WPME/Extensions/CTAs.php

    r2544682 r3320257  
    442442            // Check
    443443            if (!current_user_can('edit_posts')) return;
    444             check_ajax_referer('Genoo');
     444            check_ajax_referer('wpmktgengine');
    445445            // Code
    446446            $count = \WPME\Extensions\CTAs::getCTAsNotInWordPress();
     
    457457            // Check
    458458            if (!current_user_can('edit_posts')) return;
    459             check_ajax_referer('Genoo');
     459            check_ajax_referer('wpmktgengine');
    460460            // Code
    461461            // Things
  • wpmktgengine/trunk/libs/WPME/Extensions/Clever/Plugins.php

    r2791846 r3320257  
    3030{
    3131    /** @var array */
    32     var $notifications = array();
    33 
    34     /** @var array|mixed */
    35     var $supportedPlugins = array();
    36 
    37     /** @var array  */
    38     var $installedPlugins = array();
    39 
     32    private $supportedPlugins;
    4033    /** @var array */
    41     var $remotePlugins = array(
     34    private $installedPlugins;
     35    /** @var array */
     36    private $notifications = array();
     37    /** @var array */
     38    private $remotePlugins = array(
    4239      'wp-gravity-forms-extension-master',
    4340      'wp-genoo-elementor-addon-master',
    4441      'wp-genoo-auto-segmentation-master'
    4542    );
     43    /** @var \WPME\Nag\Nag */
     44    private $nag;
    4645
    4746    /**
     
    323322            'connection' => '',
    324323            'slug' => 'wp-genoo-auto-segmentation-master',
    325             'message' => 'Since you are using Genoo/WPMktgEngine plugin, we have an extension that will automatically segment your leads based upon their views of your blog posts.  You set a lead type by category and everything else is taken care of.',
    326             'desc' => 'Easily segment your leads by their behavior.  This plugin allows you to identify Lead Types associated with Blog Categories, so as leads visit your blog pages, automatically segment them.',
     324            'message' => 'Since you are using Genoo/WPMktgEngine plugin, we have an extension that will automatically segment your leads based upon their views of your blog posts.  You set a lead type by category and everything else is taken care of.',
     325            'desc' => 'Easily segment your leads by their behavior.  This plugin allows you to identify Lead Types associated with Blog Categories, so as leads visit your blog pages, automatically segment them.',
    327326            'name' => '',
    328327            'file' => 'wp-genoo-auto-segmentation-master/wp-genoo-auto-segmentation.php',
  • wpmktgengine/trunk/libs/WPME/Nag/Nag.php

    r1678243 r3320257  
    3535    /** @var \WPMKTENGINE\Wordpress\Nag  */
    3636    public $dummyNag;
     37   
     38    /** @var \WPMKTENGINE\RepositoryUser  */
     39    public $userRepository;
    3740
    3841    /**
  • wpmktgengine/trunk/libs/WPMKTENGINE/Admin.php

    r3198471 r3320257  
    8484    var $repositaryCTAs;
    8585    /** @var \WPME\Extensions\RepositorySurveys */
    86     var $repositorySurveys;
     86    var $repositarySurveys;
    8787    /** @var \WPMKTENGINE\RepositoryUser */
    8888    var $user;
     
    9999    /** @var \WPMKTENGINE\TablePages */
    100100    var $tablePages;
     101    /** @var \WPME\Extensions\TableSurveys */
     102    var $tableSurveys;
    101103
    102104
     
    146148            // Check
    147149            if (!current_user_can('edit_posts')) return;
    148             check_ajax_referer('Genoo');
     150            check_ajax_referer('wpmktgengine');
    149151            // Code
    150152            $option = sanitize_text_field($_POST['option']);
     
    168170            // Check
    169171            if (!current_user_can('edit_posts')) return;
    170             check_ajax_referer('Genoo');
     172            check_ajax_referer('wpmktgengine');
    171173            // Code
    172174            try {
     
    188190            // Check
    189191            if (!current_user_can('edit_posts')) return;
    190             check_ajax_referer('Genoo');
     192            check_ajax_referer('wpmktgengine');
    191193            // Code
    192194            try {
     
    203205            die;
    204206        });
    205         // Update option api
    206         Action::add('wp_ajax_refresh_surveys', function(){
    207             // Check
     207        // Flush surveys cache
     208        Action::add('wp_ajax_flush_surveys_cache', function(){
    208209            if (!current_user_can('edit_posts')) return;
    209             check_ajax_referer('Genoo');
     210            check_ajax_referer('wpmktgengine');
    210211            // Code
    211212            try {
     
    226227            // Check
    227228            if (!current_user_can('edit_posts')) return;
    228             check_ajax_referer('Genoo');
     229            check_ajax_referer('wpmktgengine');
    229230            // Code
    230231            $url = esc_url($_POST['url']);
     
    307308                'DOMAIN' => WPMKTENGINE_DOMAIN,
    308309                'AJAX' => admin_url('admin-ajax.php'),
    309                 'AJAX_NONCE' => wp_create_nonce('Genoo'),
     310                'AJAX_NONCE' => wp_create_nonce('wpmktgengine'),
    310311                'GenooPluginUrl' => WPMKTENGINE_ASSETS,
    311312                'GenooMessages'  => array(
     
    337338                'DOMAIN' => WPMKTENGINE_DOMAIN,
    338339                'AJAX' => admin_url('admin-ajax.php'),
    339                 'AJAX_NONCE' => wp_create_nonce('Genoo'),
     340                'AJAX_NONCE' => wp_create_nonce('wpmktgengine'),
    340341                'GenooPluginUrl' => WPMKTENGINE_ASSETS,
    341342                'GenooMessages'  => array(
     
    358359        global $wp_version;
    359360        if(isset($_REQUEST['page'])){
    360             if(Strings::contains($_REQUEST['page'], 'WPMKTENGINE')){
     361            $page = sanitize_text_field($_REQUEST['page']);
     362            if(Strings::contains($page, 'WPMKTENGINE')){
    361363                $classes .= ' WPMKTENGINE ';
    362364            }
     
    411413            $msgPluginLink = ' ' . Nag::adminLink(__('WPMKTGENGINE Login Page.', 'wpmktengine'), 'WPMKTENGINELogin&reset=true') . ' | ';
    412414            $msgHideLink = Nag::hideLink(__('Hide this warning.', 'wpmktengine'), 'hideGenooNag');
    413             if(!isset($_GET['page']) && (isset($_GET['page']) && $_GET['page'] !== 'WPMKTENGINELogin')){
     415            if(!isset($_GET['page']) && (isset($_GET['page']) && sanitize_text_field($_GET['page']) !== 'WPMKTENGINELogin')){
    414416                $this->addNotice('error', sprintf(__('WPMKTGENGINE plugin requires setting up. To finish your setup please login to your account.', 'wpmktengine')) . $msgPluginLink . $msgHideLink);
    415417            }
  • wpmktgengine/trunk/libs/WPMKTENGINE/Cache.php

    r2191147 r3320257  
    4343    /** @var array */
    4444    private $userConfig = array();
     45    /** @var int Cache time for dynamic property (legacy support) */
     46    private $_cache_time = 6000;
    4547
    4648
     
    320322        $this->cacheDir   = $data['cacheDir'];
    321323        $this->cacheName  = $data['cacheName'];
    322         $this->_cache_tinme = $data['cacheTime'];
     324        $this->_cache_time = $data['cacheTime'];
    323325        $this->hardFind   = $data['hardFind'];
    324326        return $this;
  • wpmktgengine/trunk/libs/WPMKTENGINE/Frontend.php

    r2902099 r3320257  
    263263                if((isset($_GET['genooIframeLumenSrc']) && !empty($_GET['genooIframeLumenSrc'])) && (!empty($wp->query_vars['genooIframeLumen']))){
    264264                    // Seems like a winner, display content
    265                     Frontend::renderPreviewLumenIframe($wp->query_vars['genooIframeLumen'], $_GET['genooIframeLumenSrc']);
     265                    $src = sanitize_text_field($_GET['genooIframeLumenSrc']);
     266                    Frontend::renderPreviewLumenIframe($wp->query_vars['genooIframeLumen'], $src);
    266267                }
    267268            }
     
    271272                // Only when query parsed do this
    272273                try {
    273                     error_reporting(0);
    274                     ini_set('error_reporting', 0);
     274                    // Only suppress error reporting for production, allow debugging in development
     275                    if (!defined('WP_DEBUG') || !WP_DEBUG) {
     276                        $error_reporting_level = error_reporting();
     277                        error_reporting(0);
     278                        ini_set('error_reporting', 0);
     279                    }
     280                   
    275281                    // Set through widget
    276282                    $widget = new WidgetCTA(false);
     
    296302                    // TODO: Discover what's causing issue with the above line
    297303                    Frontend::renderMobileWindow('Preview', $r, 'genooPreviewModal');
     304                   
     305                    // Restore error reporting if it was suppressed
     306                    if (!defined('WP_DEBUG') || !WP_DEBUG) {
     307                        error_reporting($error_reporting_level);
     308                    }
    298309                } catch (\Exception $e){
    299310                    echo $e->getMessage();
     
    678689        // Please wp.org reviewers although nothing runs after this method, as it exits
    679690        $restoreReporting = error_reporting();
    680         // Turn off errors
    681         @error_reporting(0);
    682         @ini_set('error_reporting', 0);
     691       
     692        // Only suppress errors in production, allow debugging in development
     693        if (!defined('WP_DEBUG') || !WP_DEBUG) {
     694            error_reporting(0);
     695            ini_set('error_reporting', 0);
     696        }
     697       
    683698        // Render tracking in header instead of footer?
    684699        $pageRenderTrackingInHead =
     
    763778            );
    764779        } catch (\Exception $e){
    765             echo $e->getMessage();
    766         }
    767         // Yup, makes no sense :)
     780            // Log error in production, show in development
     781            if (defined('WP_DEBUG') && WP_DEBUG) {
     782                echo $e->getMessage();
     783            } else {
     784                error_log('WPMKTGENGINE Landing Page Error: ' . $e->getMessage());
     785                echo 'An error occurred while rendering the landing page.';
     786            }
     787        }
     788        // Restore error reporting
    768789        error_reporting($restoreReporting);
    769790        ini_restore('error_reporting');
     
    779800    {
    780801        header('Content-Type: text/html; charset=utf-8');
    781         try {
    782             // Error reporting
     802       
     803        // Only suppress errors in production, allow debugging in development
     804        $restoreReporting = error_reporting();
     805        if (!defined('WP_DEBUG') || !WP_DEBUG) {
    783806            error_reporting(0);
    784807            ini_set('error_reporting', 0);
     808        }
     809       
     810        try {
    785811            $pages = new RepositoryPages($this->cache, $this->api);
    786812            $page = $pages->getPage($id);
     
    814840            }
    815841        } catch (\Exception $e){
    816             echo $e->getMessage();
    817         }
     842            // Log error in production, show in development
     843            if (defined('WP_DEBUG') && WP_DEBUG) {
     844                echo $e->getMessage();
     845            } else {
     846                error_log('WPMKTGENGINE Page Template Error: ' . $e->getMessage());
     847                echo 'An error occurred while rendering the page template.';
     848            }
     849        }
     850       
     851        // Restore error reporting
     852        error_reporting($restoreReporting);
     853        ini_restore('error_reporting');
    818854    }
    819855
  • wpmktgengine/trunk/libs/WPMKTENGINE/Import.php

    r2115344 r3320257  
    5757    {
    5858        $restoreReporting = error_reporting();
    59         // don't break us down lad
    60         @error_reporting(0);
    61         @ini_set('display_errors', 0);
     59       
     60        // Only suppress errors in production, allow debugging in development
     61        if (!defined('WP_DEBUG') || !WP_DEBUG) {
     62            error_reporting(0);
     63            ini_set('display_errors', 0);
     64        }
     65       
    6266        // return arra\`
    6367        $arr = array();
     
    114118                    return $arr;
    115119                } catch(\Exception $e){
    116                     return array(__('Error while importing lead: ', 'wpmktengine'). $e->getMessage());
     120                    // Log error in production, show in development
     121                    if (defined('WP_DEBUG') && WP_DEBUG) {
     122                        return array(__('Error while importing lead: ', 'wpmktengine'). $e->getMessage());
     123                    } else {
     124                        error_log('WPMKTGENGINE Import Error: ' . $e->getMessage());
     125                        return array(__('Error while importing lead. Check error logs for details.', 'wpmktengine'));
     126                    }
    117127                }
    118128            } else {
     
    123133            }
    124134        }
     135       
     136        // Restore error reporting
    125137        error_reporting($restoreReporting);
    126138        ini_restore('display_errors');
     
    138150    public function importSubscribers($subscribers, $leadType)
    139151    {
    140         @error_reporting(0);
    141         @ini_set('display_errors', 0);
     152        // Only suppress errors in production, allow debugging in development
     153        $restoreReporting = error_reporting();
     154        if (!defined('WP_DEBUG') || !WP_DEBUG) {
     155            error_reporting(0);
     156            ini_set('display_errors', 0);
     157        }
     158       
    142159        // return array
    143160        $arr = array();
     
    173190                return $arr;
    174191            } catch(\Exception $e){
    175                 return array(__('Error while importing lead: ', 'wpmktengine'). $e->getMessage());
    176             }
    177         }
     192                // Log error in production, show in development
     193                if (defined('WP_DEBUG') && WP_DEBUG) {
     194                    return array(__('Error while importing lead: ', 'wpmktengine'). $e->getMessage());
     195                } else {
     196                    error_log('WPMKTGENGINE Subscriber Import Error: ' . $e->getMessage());
     197                    return array(__('Error while importing lead. Check error logs for details.', 'wpmktengine'));
     198                }
     199            }
     200        }
     201       
     202        // Restore error reporting
     203        error_reporting($restoreReporting);
     204        ini_restore('display_errors');
    178205        return array(__('No subscribers provided.', 'wpmktengine'));
    179206    }
  • wpmktgengine/trunk/libs/WPMKTENGINE/RepositoryLumens.php

    r2191147 r3320257  
    5151     */
    5252    private $api;
     53    /**
     54     * @var bool
     55     */
     56    private $empty = false;
    5357
    5458    const REPO_TIMER = '3600';
  • wpmktgengine/trunk/libs/WPMKTENGINE/Table.php

    r2243770 r3320257  
    7777        if(isset($_POST['wp_screen_options'])){
    7878            if(isset($_POST['wp_screen_options']['option']) && $_POST['wp_screen_options']['option'] == 'genoo_per_page'){
    79                 return $_POST['wp_screen_options']['value'];
     79                return sanitize_text_field($_POST['wp_screen_options']['value']);
    8080            }
    8181        }
  • wpmktgengine/trunk/libs/WPMKTENGINE/Users.php

    r1905876 r3320257  
    126126    {
    127127        if(isset($_POST)){
    128             @$first = isset($_POST['billing_first_name']) ? $_POST['billing_first_name'] : null;
     128            @$first = isset($_POST['billing_first_name']) ? sanitize_text_field($_POST['billing_first_name']) : null;
    129129            if($first === null){
    130                 @$first = isset($_POST['shipping_first_name']) ? $_POST['shipping_first_name'] : null;
     130                @$first = isset($_POST['shipping_first_name']) ? sanitize_text_field($_POST['shipping_first_name']) : null;
    131131                if($first === null){
    132                     @$first = isset($_POST['first_name']) ? $_POST['first_name'] : null;
     132                    @$first = isset($_POST['first_name']) ? sanitize_text_field($_POST['first_name']) : null;
    133133                }
    134134            }
     
    146146    {
    147147        if(isset($_POST)){
    148             @$first = isset($_POST['billing_last_name']) ? $_POST['billing_last_name'] : null;
     148            @$first = isset($_POST['billing_last_name']) ? sanitize_text_field($_POST['billing_last_name']) : null;
    149149            if($first === null){
    150                 @$first = isset($_POST['shipping_last_name']) ? $_POST['shipping_last_name'] : null;
     150                @$first = isset($_POST['shipping_last_name']) ? sanitize_text_field($_POST['shipping_last_name']) : null;
    151151                if($first === null){
    152                     @$first = isset($_POST['last_name']) ? $_POST['last_name'] : null;
     152                    @$first = isset($_POST['last_name']) ? sanitize_text_field($_POST['last_name']) : null;
    153153                }
    154154            }
  • wpmktgengine/trunk/libs/WPMKTENGINE/Utils/Strings.php

    r2761866 r3320257  
    371371    public static function length($s)
    372372    {
    373         return strlen(utf8_decode($s)); // fastest way
     373        // Replace deprecated utf8_decode with modern alternative
     374        if (function_exists('mb_strlen')) {
     375            return mb_strlen($s, 'UTF-8');
     376        } else {
     377            // Fallback for systems without mbstring
     378            return strlen($s);
     379        }
    374380    }
    375381
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/Ajax.php

    r1573240 r3320257  
    143143    public static function onReturn($data)
    144144    {
    145         @error_reporting(0); // don't break json
     145        // Only suppress error reporting for production, allow debugging in development
     146        $restoreReporting = error_reporting();
     147        if (!defined('WP_DEBUG') || !WP_DEBUG) {
     148            error_reporting(0);
     149        }
     150       
    146151        header('Content-type: application/json');
    147152        try{
    148             die(Json::encode($data));
    149         } catch (\Exception $e){} // as of this moment, we don't do anything with exceptions, it's ajax call
    150                                   // they would just break the thang
     153            $json_data = Json::encode($data);
     154            if (json_last_error() !== JSON_ERROR_NONE) {
     155                throw new \Exception('JSON encoding error: ' . json_last_error_msg());
     156            }
     157            die($json_data);
     158        } catch (\Exception $e){
     159            // Log the exception for debugging but don't expose it to the client
     160            error_log('WPMKTGENGINE AJAX Error: ' . $e->getMessage());
     161           
     162            // Return a generic error response
     163            $error_response = array('error' => 'Internal server error');
     164            if (defined('WP_DEBUG') && WP_DEBUG) {
     165                $error_response['debug_message'] = $e->getMessage();
     166            }
     167            die(Json::encode($error_response));
     168        } finally {
     169            // Restore error reporting
     170            error_reporting($restoreReporting);
     171        }
    151172    }
    152173}
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/Cron.php

    r1573240 r3320257  
    117117    {
    118118        $events = self::getEvents();
    119         error_reporting(0);
     119       
     120        // Only suppress error reporting for production, allow debugging in development
     121        $restoreReporting = error_reporting();
     122        if (!defined('WP_DEBUG') || !WP_DEBUG) {
     123            error_reporting(0);
     124        }
     125       
    120126        if(!empty($events)){
    121127            foreach($events as $time => $cron){
     
    131137            }
    132138        }
     139       
     140        // Restore error reporting
     141        error_reporting($restoreReporting);
    133142    }
    134143
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/Http.php

    r2106417 r3320257  
    1616 *  http://www.wpmktgengine.com/terms-of-service
    1717 *  Copyright 2016 Genoo LLC. All rights reserved worldwide.
     18 *
     19 * SECURITY NOTE:
     20 * SSL verification is enabled by default for security. To disable SSL verification
     21 * (only for development/testing), use the filter: add_filter('wpmktgengine_ssl_verify', '__return_false');
     22 * WARNING: Disabling SSL verification in production is a security risk.
    1823 */
    1924
     
    2833    var $response;
    2934    /** @var array */
    30     var $args = array('sslverify' => false, 'timeout' => 120);
     35    var $args = array('sslverify' => true, 'timeout' => 120);
    3136    /** @var  */
    3237    var $url;
     
    4550        $this->url = $url;
    4651        $this->apikeySetup();
     52        // Allow SSL verification to be configured via filter
     53        $sslVerify = apply_filters('wpmktgengine_ssl_verify', true);
     54        $this->args['sslverify'] = $sslVerify;
    4755        return $this;
    4856    }
     
    149157
    150158    /**
     159     * Configure SSL verification for cURL operations
     160     *
     161     * @param resource $ch cURL handle
     162     */
     163    private function configureCurlSSL($ch)
     164    {
     165        $sslVerify = apply_filters('wpmktgengine_ssl_verify', true);
     166        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $sslVerify);
     167        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $sslVerify ? 2 : 0);
     168    }
     169
     170    /**
    151171     * Couldn't get working with WP_Http,
    152172     * so changed to work with curl
     
    170190        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    171191        curl_setopt($ch, CURLOPT_HTTPHEADER, $headersNew);
     192        // Configure SSL verification
     193        $this->configureCurlSSL($ch);
    172194        // Set body
    173195        curl_setopt($ch, CURLOPT_POST, 1);
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/Metabox.php

    r2549298 r3320257  
    110110        if (!isset($_POST[$this->nonceKey])){ return $post_id; }
    111111        // nonce key
    112         $nonce = $_POST[$this->nonceKey];
     112        $nonce = sanitize_text_field($_POST[$this->nonceKey]);
    113113        // verify that the nonce is valid.
    114114        if (!wp_verify_nonce($nonce, $this->id)){ return $post_id; }
     
    125125                      update_post_meta($post_id, $fieldId, $_POST[$fieldId]);
    126126                    } else {
    127                       update_post_meta($post_id, $fieldId, (sanitize_text_field($_POST[$fieldId])));
     127                      update_post_meta($post_id, $fieldId, sanitize_text_field($_POST[$fieldId]));
    128128                    }
    129129                } elseif(empty($_POST[$fieldId])) {
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/MetaboxCTA.php

    r1603372 r3320257  
    3838    /** @var  */
    3939    var $ctas;
     40    /** @var array */
     41    var $fields;
     42    /** @var array */
     43    var $fieldsSanatized;
    4044
    4145
     
    236240        if(isset($_POST[$this->id]) && is_array($_POST[$this->id])){
    237241            foreach($_POST[$this->id] as $key => $value){
     242                $_POST[$this->id][$key] = sanitize_text_field($value);
     243            }
     244            foreach($_POST[$this->id] as $key => $value){
    238245                $current = $key;
    239246                if(is_array($value)){
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/Settings.php

    r1801691 r3320257  
    139139                if (isset($section['desc']) && !empty($section['desc'])){
    140140                    $section['desc'] = '<div class="inside">'.$section['desc'].'</div>';
    141                     $callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'";');
     141                    $callback = function() use ($section) {
     142                        echo str_replace('"', '\"', $section['desc']);
     143                    };
    142144                } else {
    143145                    $callback = '__return_false';
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/TableLite.php

    r2761866 r3320257  
    9595     */
    9696    protected $modes = array();
     97
     98    /**
     99     * Screen ID for dynamic property support
     100     *
     101     * @var string
     102     */
     103    public $screenId;
     104
     105    /**
     106     * Screen options for dynamic property support
     107     *
     108     * @var array
     109     */
     110    public $screenOptions;
     111
     112    /**
     113     * User per page setting for dynamic property support
     114     *
     115     * @var int
     116     */
     117    public $userPerpage;
     118
     119    /**
     120     * Per page setting for dynamic property support
     121     *
     122     * @var int
     123     */
     124    public $perPage;
    97125
    98126    /**
     
    785813            $current_orderby = '';
    786814
    787         if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
     815        if ( isset( $_GET['order'] ) && 'desc' == sanitize_text_field($_GET['order']) )
    788816            $current_order = 'desc';
    789817        else
  • wpmktgengine/trunk/libs/WPMKTENGINE/Wordpress/Utils.php

    r2526947 r3320257  
    163163    public static function underscoreToCamelCase($string, $firstCaps = true)
    164164    {
    165         if($firstCaps == true){$string[0] = strtoupper($string[0]); } $func = create_function('$c', 'return strtoupper($c[1]);');
    166         return preg_replace_callback('/_([a-z])/', $func, $string);
     165        if($firstCaps == true){$string[0] = strtoupper($string[0]); }
     166        return preg_replace_callback('/_([a-z])/', function($c) {
     167            return strtoupper($c[1]);
     168        }, $string);
    167169    }
    168170
  • wpmktgengine/trunk/wpmktgengine-init.php

    r2544682 r3320257  
    8888        // Dropins
    8989        require_once WPMKTENGINE_ROOT .  '/extensions/dropins.php';
     90       
    9091        // initialize
    9192        $this->repositarySettings = new \WPME\RepositorySettingsFactory();
     
    289290    function genoo_wpme_on_return($data)
    290291    {
    291         @error_reporting(0); // don't break json
     292        // Only suppress error reporting for production, allow debugging in development
     293        if (!defined('WP_DEBUG') || !WP_DEBUG) {
     294            // In production, suppress errors but log them
     295            $error_reporting_level = error_reporting();
     296            error_reporting(0);
     297           
     298            // Log any errors that might occur during JSON encoding
     299            $json_data = json_encode($data);
     300            if (json_last_error() !== JSON_ERROR_NONE) {
     301                error_log('WPMKTGENGINE JSON encoding error: ' . json_last_error_msg());
     302                $data = array('error' => 'Data encoding failed');
     303                $json_data = json_encode($data);
     304            }
     305           
     306            // Restore error reporting level
     307            error_reporting($error_reporting_level);
     308        } else {
     309            // In development, let errors show but ensure clean JSON output
     310            $json_data = json_encode($data);
     311            if (json_last_error() !== JSON_ERROR_NONE) {
     312                wp_die('JSON encoding error: ' . json_last_error_msg());
     313            }
     314        }
     315       
    292316        header('Content-type: application/json');
    293         die(json_encode($data));
     317        die($json_data);
    294318    }
    295319}
  • wpmktgengine/trunk/wpmktgengine-requirements.php

    r2195197 r3320257  
    3333        // minimum versions
    3434        $checkMinWp  = '4.5';
    35         $checkMinPHP = '5.5.0';
     35        $checkMinPHP = '7.4.0';
    3636        $checkMinMemory = 20 * (1024 * 1024);
    3737        // recover hideLink
  • wpmktgengine/trunk/wpmktgengine.php

    r3241019 r3320257  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 4.0.29
     8    Version: 4.0.30
    99    License: GPLv2
    1010    Text Domain: wpmktgengine
     11    Requires at least: 4.5
     12    Tested up to: 6.8.1
     13    Requires PHP: 7.4
     14    Tested up to PHP: 8.3
    1115*/
    1216/**
Note: See TracChangeset for help on using the changeset viewer.