Plugin Directory

Changeset 3011713


Ignore:
Timestamp:
12/19/2023 06:46:52 AM (2 years ago)
Author:
nikmelnik
Message:

Релиз версии 1.0.4 плагина Realbig

Изменения версии:

  • улучшили защиту плагина.
Location:
realbig-media/trunk
Files:
14 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • realbig-media/trunk/README.MD

    r2986533 r3011713  
    33Tags: AD, content filling
    44Requires at least: 4.5
    5 Tested up to: 6.3
     5Tested up to: 6.4
    66Stable tag: 0.1.26.56
    77Requires PHP: 5.6
     
    108108== Changelog ==
    109109
     110= 1.0.5 =
     111
     112Изменения версии:
     113
     114* улучшили защиту плагина.
     115
    110116= 1.0.4 =
    111117
  • realbig-media/trunk/README.txt

    r2986533 r3011713  
    33Tags: AD, content filling
    44Requires at least: 4.5
    5 Tested up to: 6.3
     5Tested up to: 6.4
    66Stable tag: 0.1.26.56
    77Requires PHP: 5.6
     
    108108== Changelog ==
    109109
     110= 1.0.5 =
     111
     112Изменения версии:
     113
     114* улучшили защиту плагина.
     115
    110116= 1.0.4 =
    111117
  • realbig-media/trunk/RFWP_AdminPage.php

    r2986533 r3011713  
    3333
    3434        public static function tokenSync() {
     35            if (!is_admin() || !current_user_can('activate_plugins'))
     36                return;
     37
    3538            global $wpdb;
    3639            global $wpPrefix;
     
    154157
    155158        public static function clickButtons() {
    156             if (!empty($_POST['clearLogs'])) {
    157                 RFWP_Logs::clearAllLogs();
    158             }
    159             else if (!empty($_POST['clearCache'])) {
    160                 RFWP_Cache::clearCaches();
     159            if (wp_get_raw_referer() && !wp_get_referer() && !empty($_POST)) {
     160                if (!empty($GLOBALS['wpPrefix'])) {
     161                    $wpPrefix = $GLOBALS['wpPrefix'];
     162                } else {
     163                    global $table_prefix;
     164                    $wpPrefix = $table_prefix;
     165                }
     166
     167                if (!empty($_POST['clearLogs'])) {
     168                    RFWP_Logs::clearAllLogs();
     169                }
     170                else if (!empty($_POST['clearCache'])) {
     171                    RFWP_Cache::clearCaches();
     172                }
     173
     174                /* manual sync */
     175                $updateLogs = false;
     176                if (!empty($_POST['enableLogsButton'])) {
     177                    RFWP_Utils::saveToRbSettings(!empty($_POST['enable_logs']) ? '1' : '0', "enableLogs");
     178                    $updateLogs = true;
     179                }
     180                if (!empty($_POST['saveTokenButton'])) {
     181                    if (!empty($_POST['cache_clear'])) {
     182                        update_option('rb_cacheClearAllow', 'enabled');
     183                    } else {
     184                        update_option('rb_cacheClearAllow', 'disabled');
     185                    }
     186                }
     187                if (!empty($_POST['tokenInput'])) {
     188                    $sanitized_token = sanitize_text_field($_POST['tokenInput']);
     189                    if (RFWP_tokenMDValidate($sanitized_token)==true) {
     190                        $sameTokenResult = false;
     191                        if (!isset($GLOBALS['RFWP_synchronize_vars'])) {
     192                            $GLOBALS['RFWP_synchronize_vars'] = [];
     193                            $GLOBALS['RFWP_synchronize_vars']['token'] = $sanitized_token;
     194                            $GLOBALS['RFWP_synchronize_vars']['sameTokenResult'] = $sameTokenResult;
     195                            $GLOBALS['RFWP_synchronize_vars']['type'] = 'manual';
     196                            $GLOBALS['RFWP_synchronize_vars']['updateLogs'] = $updateLogs;
     197                        }
     198
     199                        RFWP_synchronizeLaunchAdd();
     200                        add_action('wp_loaded', 'RFWP_cronAutoGatheringLaunch');
     201                    } else {
     202                        $GLOBALS['tokenStatusMessage'] = 'Неверный формат токена';
     203                        $messageFLog = 'wrong token format';
     204                    }
     205                } elseif ($GLOBALS['token'] == 'no token') {
     206                    $GLOBALS['tokenStatusMessage'] = 'Введите токен';
     207                    $messageFLog = 'no token';
     208                }
     209                if (!empty($messageFLog)) {
     210                    RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog);
     211                }
     212                RFWP_tokenTimeUpdateChecking($GLOBALS['token'], $wpPrefix);
     213                /* end of manual sync */
     214
     215                /* check ip */
     216                if (!empty($_POST['checkIp'])) {
     217                    $thisUrl = 'http://ifconfig.co/ip';
     218                    $curl = curl_init();
     219                    curl_setopt($curl,CURLOPT_URL, $thisUrl);
     220                    curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
     221                    curl_setopt($curl,CURLOPT_IPRESOLVE,CURL_IPRESOLVE_V4);
     222                    $curlResult = curl_exec($curl);
     223                    if (!empty($curlResult)) {
     224                        global $curlResult;
     225                        RFWP_Logs::saveLogs(RFWP_Logs::IP_LOG, PHP_EOL.$curlResult);
     226                    }
     227                    curl_close($curl);
     228                }
     229                /* end of check ip */
    161230            }
    162231        }
  • realbig-media/trunk/realbigForWP.php

    r2986533 r3011713  
    66Plugin name:  Realbig Media
    77Description:  Плагин для монетизации от RealBig.media
    8 Version:      1.0.4
     8Version:      1.0.5
    99Author:       Realbig Team
    1010Author URI:   https://realbig.media
     
    134134        &&!empty($GLOBALS['rb_variables']['adDomain'])
    135135    ) {
    136         if (((!empty($_POST['action'])&&$_POST['action']=='heartbeat')||!empty(apply_filters('wp_doing_cron', defined('DOING_CRON') && DOING_CRON)))&&!isset($GLOBALS['rb_variables']['localRotatorGatherTimeout'])) {
    137             $GLOBALS['rb_variables']['localRotatorGatherTimeout'] = get_transient(RFWP_Variables::LOCAL_ROTATOR_GATHER);
     136        if (((!empty($_POST['action'])&&$_POST['action']=='heartbeat')||!empty(apply_filters('wp_doing_cron', defined('DOING_CRON') && DOING_CRON)))&&!isset($GLOBALS['rb_variables'][RFWP_Variables::LOCAL_ROTATOR_GATHER])) {
     137            $GLOBALS['rb_variables'][RFWP_Variables::LOCAL_ROTATOR_GATHER] = get_transient(RFWP_Variables::LOCAL_ROTATOR_GATHER);
    138138        }
    139139        if ((!empty($_POST['saveTokenButton']))
    140             ||(isset($GLOBALS['rb_variables']['localRotatorGatherTimeout'])&&empty($GLOBALS['rb_variables']['localRotatorGatherTimeout']))
     140            ||(isset($GLOBALS['rb_variables'][RFWP_Variables::LOCAL_ROTATOR_GATHER])&&empty($GLOBALS['rb_variables'][RFWP_Variables::LOCAL_ROTATOR_GATHER]))
    141141        ) {
    142142            RFWP_createLocalRotator();
     
    949949    }
    950950    /********** end of adding AD code in head area ************************************************************************/
    951     /********** manual sync ***********************************************************************************************/
    952     if (empty(apply_filters('wp_doing_cron', defined('DOING_CRON')&&DOING_CRON))) {
    953         if (!empty($curUserCan)&&strpos($GLOBALS['PHP_SELF'], 'wp-admin')!= false) {
    954             $updateLogs = false;
    955             if (!empty($_POST['enableLogsButton'])) {
    956                 RFWP_Utils::saveToRbSettings(!empty($_POST['enable_logs']) ? '1' : '0', "enableLogs");
    957                 $updateLogs = true;
    958             }
    959             if (!empty($_POST['saveTokenButton'])) {
    960                 if (!empty($_POST['cache_clear'])) {
    961                     update_option('rb_cacheClearAllow', 'enabled');
    962                 } else {
    963                     update_option('rb_cacheClearAllow', 'disabled');
    964                 }
    965             }
    966             if (!empty($_POST['tokenInput'])) {
    967                 $sanitized_token = sanitize_text_field($_POST['tokenInput']);
    968                 if (RFWP_tokenMDValidate($sanitized_token)==true) {
    969                     $sameTokenResult = false;
    970                     if (!isset($GLOBALS['RFWP_synchronize_vars'])) {
    971                         $GLOBALS['RFWP_synchronize_vars'] = [];
    972                         $GLOBALS['RFWP_synchronize_vars']['token'] = $sanitized_token;
    973                         $GLOBALS['RFWP_synchronize_vars']['sameTokenResult'] = $sameTokenResult;
    974                         $GLOBALS['RFWP_synchronize_vars']['type'] = 'manual';
    975                         $GLOBALS['RFWP_synchronize_vars']['updateLogs'] = $updateLogs;
    976                     }
    977 
    978                     RFWP_synchronizeLaunchAdd();
    979                     add_action('wp_loaded', 'RFWP_cronAutoGatheringLaunch');
    980                 } else {
    981                     $GLOBALS['tokenStatusMessage'] = 'Неверный формат токена';
    982                     $messageFLog = 'wrong token format';
    983                 }
    984             } elseif ($GLOBALS['token'] == 'no token') {
    985                 $GLOBALS['tokenStatusMessage'] = 'Введите токен';
    986                 $messageFLog = 'no token';
    987             }
    988             if (!empty($messageFLog)) {
    989                 RFWP_Logs::saveLogs(RFWP_Logs::ERRORS_LOG, $messageFLog);
    990             }
    991             RFWP_tokenTimeUpdateChecking($GLOBALS['token'], $wpPrefix);
    992         }
    993     }
    994     /********** end of manual sync ****************************************************************************************/
    995951    /************* blocks for text ****************************************************************************************/
    996952    if (empty(apply_filters('wp_doing_cron',defined('DOING_CRON')&&DOING_CRON))&&!is_admin()) {
  • realbig-media/trunk/synchronising.php

    r2971623 r3011713  
    10391039                        $GLOBALS['rb_variables']['localRotatorUrl'] = $urlToFile;
    10401040                        set_transient(RFWP_Variables::LOCAL_ROTATOR_GATHER, true, 15*60);
    1041                         $GLOBALS['rb_variables']['localRotatorGatherTimeout'] = true;
     1041                        $GLOBALS['rb_variables'][RFWP_Variables::LOCAL_ROTATOR_GATHER] = null;
    10421042                        break;
    10431043                    }
  • realbig-media/trunk/templates/adminPage/sync.php

    r2971623 r3011713  
    3232    <?php endif; ?>
    3333    <?php if (!empty($args['devMode'])): ?>
    34         <?php submit_button( 'Check-Ip', 'big', 'checkIp', true) ?>
     34        <?php submit_button( 'Check-Ip', 'big', 'checkIp') ?>
    3535        <?php if (!empty($args['curlResult'])): ?>
    3636            <span id="ip-result"><?php echo $args['curlResult'] ?></span>
  • realbig-media/trunk/testFunctions.php

    r2884028 r3011713  
    44// 1 - ok connection; 2 - error connection;
    55$kill_rb_db = $wpdb->get_results('SELECT id,optionValue FROM '.$wpPrefix.'realbig_settings WHERE optionName = "kill_rb"', ARRAY_A);
    6 if (empty(apply_filters('wp_doing_cron', defined('DOING_CRON') && DOING_CRON))&&!empty(is_admin())) {
     6if (empty(apply_filters('wp_doing_cron', defined('DOING_CRON') && DOING_CRON)) && !empty(is_admin())
     7    && wp_get_raw_referer() && !wp_get_referer()) {
    78    if (!empty($curUserCan)&&!empty($_POST['saveTokenButton'])) {
    89        if (!empty($_POST['kill_rb'])) {
     
    3839/** End of kill rb connection emulation */
    3940/** Check IP */
    40 if (!empty($_POST['checkIp'])&&is_admin()&&empty(apply_filters('wp_doing_cron', defined('DOING_CRON')&&DOING_CRON))) {
    41     $thisUrl = 'http://ifconfig.co/ip';
    42 //          $thisResultSaved = get_option('checkIpResult');
    43 //          if (empty($thisResultSaved)) {
    44 //              $thisResult = wp_remote_get($thisUrl);
    45 //              if (!empty($thisResult)&&!empty($thisResult['body'])) {
    46 //                  error_log(PHP_EOL.current_time('mysql').':'.$thisResult['body'].PHP_EOL, 3, $checkIpLogFile);
    47 //              }
    48 //          }
    49     $curl = curl_init();
    50     curl_setopt($curl,CURLOPT_URL, $thisUrl);
    51     curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
    52     curl_setopt($curl,CURLOPT_IPRESOLVE,CURL_IPRESOLVE_V4);
    53     $curlResult = curl_exec($curl);
    54     if (!empty($curlResult)) {
    55         global $curlResult;
    56         RFWP_Logs::saveLogs(RFWP_Logs::IP_LOG, PHP_EOL.$curlResult);
    57     }
    58     curl_close($curl);
    59 }
    60 
    6141if (!empty($curUserCan)) {
    6242    $testServerName = 'placeholder';
Note: See TracChangeset for help on using the changeset viewer.