Plugin Directory

Changeset 3259801


Ignore:
Timestamp:
03/21/2025 03:18:24 PM (9 months ago)
Author:
veppa
Message:

Optimization and bugfixes 1.3.7

Location:
http-requests-manager
Files:
5 edited
6 copied

Legend:

Unmodified
Added
Removed
  • http-requests-manager/tags/1.3.7/a-http-requests-manager.php

    r3081974 r3259801  
    66  Author: veppa
    77  Author URI: https://veppa.com/
    8   Version: 1.0
     8  Version: 1.0.2
    99  Text Domain: http-requests-manager
    1010  Network: true
    11 
    12   Copyright (C) 2015-23 CERBER TECH INC., https://cerber.tech
    13   Copyright (C) 2015-23 Markov Gregory, https://wpcerber.com
    1411
    1512  Licenced under the GNU GPL.
     
    3633define('VPHRM_MODE_INIT', 1);
    3734
    38 if(in_array('http-requests-manager/http-requests-manager.php', apply_filters('active_plugins', get_option('active_plugins', array()))))
     35// make sure that we are in mu folder
     36if(str_replace("\\", "/", __DIR__) === str_replace("\\", "/", WPMU_PLUGIN_DIR))
    3937{
    40     // plugin active load it.
    41     if(( @include_once WP_PLUGIN_DIR . '/http-requests-manager/http-requests-manager.php' ) == true)
     38    $_vphrm_active_plugins = apply_filters('active_plugins', get_option('active_plugins', array()));
     39
     40    // include only if plugin active
     41    if(empty($_vphrm_active_plugins))
    4242    {
    43         define('VPHRM_MODE', 1);
     43        // no plugin is active. something wrong.
     44        // do nothing. it is temporaty state maybe when all plugins disabled.
     45        if(!file_exists(WP_PLUGIN_DIR . '/http-requests-manager/http-requests-manager.php'))
     46        {
     47            // main plugin file is not there remove this MU loader
     48            @unlink(__FILE__);
     49        }
     50    }
     51    elseif(is_array($_vphrm_active_plugins) && in_array('http-requests-manager/http-requests-manager.php', $_vphrm_active_plugins))
     52    {
     53        // plugin active load it.
     54        if(( @include_once WP_PLUGIN_DIR . '/http-requests-manager/http-requests-manager.php' ) == true)
     55        {
     56            define('VPHRM_MODE', 1);
     57        }
     58    }
     59    else
     60    {
     61        // only this plugin is not active
     62        // delete self because plugin is disabled without removing mu loader
     63        @unlink(__FILE__);
    4464    }
    4565}
    46 elseif(__DIR__ === WPMU_PLUGIN_DIR)
    47 {
    48     // delete self because plugin is disabled without removing mu loader
    49     @unlink(__FILE__);
    50 }
     66
     67
     68
  • http-requests-manager/tags/1.3.7/http-requests-manager.php

    r3178540 r3259801  
    55  Plugin URI:   https://veppa.com/http-requests-manager/
    66  Description: Limit, Debug, Optimize WP_HTTP requests. Limit by request count, page load time, reduce timeout for each request. Speed up login and admin pages.
    7   Version: 1.3.6
     7  Version: 1.3.7
    88  Author: veppa
    99  Author URI: https://veppa.com/
     
    3030
    3131/**
     32 * 
    3233 * TODO:
    33  *
    3434  - add blocking by theme
    3535  - add blocking by core function
    36   - disable all enclosure checks and rely only on file extension
    3736  - safe-mode: show instruction about safe mode and operation mode on beginning. after dismissed move note to bottom.
    3837  - [maybe] group prevent enclosure checks and pingbacks. write 1 log instead of 50+
    39   - reduce ajax data. sometimes report loads slow. 230kb compressed = 1.3mb uncompressed
    40   - truncate long response,
    41   - remove duplicate info about requests in page array.
    4238  - optimization: define hooks only for selected mode and logging combination. define hooks granularly.
     39
     40 *
     41 * NOT POSSIBLE:
     42  -- disable all enclosure checks and rely only on file extension. (not possible, detection using ext done after getting positive response using WP_HTTP )
    4343  -------------------------------------------
    4444 * conflict test.
     
    7575class HTTP_Requests_Manager
    7676{
    77    
    78     const VERSION = '1.3.6';
     77
     78    const VERSION = '1.3.6.2';
    7979    const ID = 'http-requests-manager';
    8080    const TIMEOUT = 2;
     81    const DATA_TRUNCATE_LIMIT = 5000; // truncate response data if bigger than 6kb.  should always be (limit>=value)
     82    const DATA_TRUNCATE_VALUE = 3000; // truncate to 5kb. we do not need to see or store full (large) reponse.
    8183
    8284    public static $instance;
     
    216218    {
    217219        $arr_my_ajax_actions = array(
    218             'vphrm_query'                => true,
    219             'vphrm_clear'                => true,
    220             'vphrm_disable_logging'      => true,
    221             'vphrm_load_must_use'        => true,
    222             'vphrm_save_view'            => true,
    223             'vphrm_custom_rule_save'    => true,
    224             'vphrm_custom_rule_delete'  => true,
    225             'vphrm_mode'                => true,
    226             'vphrm_mode_change'          => true
     220            'vphrm_query' => true,
     221            'vphrm_clear' => true,
     222            'vphrm_disable_logging' => true,
     223            'vphrm_load_must_use' => true,
     224            'vphrm_save_view' => true,
     225            'vphrm_custom_rule_save' => true,
     226            'vphrm_custom_rule_delete' => true,
     227            'vphrm_mode' => true,
     228            'vphrm_mode_change' => true
    227229        );
    228230
     
    413415        $output['pager'] = $this->db_paginate();
    414416
    415         wp_send_json($output);
     417        //$output = self::json_reduce_slashes($output);
     418
     419        self::wp_send_json($output);
    416420    }
    417421
     
    431435
    432436        $output = [
    433             'mode'  => self::get_mode(),
    434             'modes'  => self::modes()
     437            'mode' => self::get_mode(),
     438            'modes' => self::modes()
    435439        ];
    436440
    437         wp_send_json($output);
     441        self::wp_send_json($output);
    438442    }
    439443
     
    460464
    461465
    462         wp_send_json($output);
     466        self::wp_send_json($output);
    463467    }
    464468
     
    483487
    484488
    485         wp_send_json($output);
     489        self::wp_send_json($output);
    486490    }
    487491
     
    649653    }
    650654
     655    /**
     656     * check if MU file has new version. upgrade file when necessary
     657     */
     658    private static function load_must_use_upgrade_check()
     659    {
     660        $src = VPHRM_DIR . self::$mu_plugin_file_name;
     661        $dest = WPMU_PLUGIN_DIR . self::$mu_plugin_file_name;
     662
     663        // is mu active
     664        if(file_exists($dest) && file_exists($src))
     665        {
     666            // get  versions           
     667            $src_info = get_file_data($src, array('Version' => 'Version'));
     668            $dest_info = get_file_data($dest, array('Version' => 'Version'));
     669
     670            // update if version different
     671            if(!empty($src_info['Version']) && !empty($dest_info['Version']) && $src_info['Version'] !== $dest_info['Version'])
     672            {
     673                // remove old mu file and set new one
     674                self::load_must_use_remove();
     675                self::load_must_use_set();
     676            }
     677        }
     678    }
     679
    651680    function vphrm_load_must_use()
    652681    {
     
    687716        }
    688717
    689         wp_send_json($output);
     718        self::wp_send_json($output);
    690719    }
    691720
     
    715744                    break;
    716745                default:
    717                     wp_send_json(array(
    718                         'status'    => 'error',
    719                         'message'    => __('Rule type is not valid', 'http-requests-manager')
     746                    self::wp_send_json(array(
     747                        'status' => 'error',
     748                        'message' => __('Rule type is not valid', 'http-requests-manager')
    720749                    ));
    721750                    return false;
     
    776805                    $output['message'] = sprintf(
    777806                            __('You have reached custom rule limit of %d. Please contact us if you need more custom rules.', 'http-requests-manager'),
    778           self::$custom_rules_limit
     807                            self::$custom_rules_limit
    779808                    );
    780809                }
     
    794823        }
    795824
    796         wp_send_json($output);
     825        self::wp_send_json($output);
    797826    }
    798827
     
    841870        }
    842871
    843         wp_send_json($output);
     872        self::wp_send_json($output);
    844873    }
    845874
     
    10641093        }
    10651094
    1066         wp_send_json($output);
     1095        self::wp_send_json($output);
    10671096    }
    10681097
     
    11541183    {
    11551184        $row = array(
    1156             'url'        => $url,
    1157             'runtime'    => round(microtime(true) - $this->start_time, 3),
     1185            'url' => $url,
     1186            'runtime' => round(microtime(true) - $this->start_time, 3),
    11581187            'total_time' => self::timer_float()
    11591188        );
     
    13491378        {
    13501379            self::$modes = array(
    1351                 'log'                    => __('Only log HTTP requests', 'http-requests-manager'),
    1352                 'log_all'                => __('Only log HTTP requests (+ cron requests)', 'http-requests-manager'),
    1353                 'block_smart'            => __('Smart block', 'http-requests-manager'),
    1354                 'block_external'        => __('Block external requests', 'http-requests-manager'),
    1355                 'block_external_no_wp'  => __('Block external requests (allow WordPress.org only)', 'http-requests-manager')
     1380                'log' => __('Only log HTTP requests', 'http-requests-manager'),
     1381                'log_all' => __('Only log HTTP requests (+ cron requests)', 'http-requests-manager'),
     1382                'block_smart' => __('Smart block', 'http-requests-manager'),
     1383                'block_external' => __('Block external requests', 'http-requests-manager'),
     1384                'block_external_no_wp' => __('Block external requests (allow WordPress.org only)', 'http-requests-manager')
    13561385            );
    13571386        }
     
    13831412        // False to ignore current row
    13841413        $log_data = apply_filters('vphrm_log_page_data', [
    1385             'url'        => self::page_url(),
    1386             'page_type'  => self::db_truncate_field(self::current_page_type(), 20),
    1387             'runtime'    => self::timer_float(),
    1388             'info'       => json_encode($info),
     1414            'url' => self::page_url(),
     1415            'page_type' => self::db_truncate_field(self::current_page_type(), 20),
     1416            'runtime' => self::timer_float(),
     1417            'info' => self::json_encode($info),
    13891418            'date_added' => current_time('mysql')
    13901419        ]);
     
    14591488         */
    14601489
     1490        // convert obj to array reponse to work simpler and without any private protected properties.
     1491        $arr_response = self::obj2arr($response);
     1492
     1493        // reduce response body
     1494        self::trim_reponse_body($arr_response);
     1495
    14611496        // False to ignore current row
    14621497        $log_data = apply_filters('vphrm_log_data', [
    1463             'url'            => $url,
    1464             'request_args'   => json_encode($args),
    1465             'response'       => json_encode($response),
    1466             'runtime'        => ( microtime(true) - $this->start_time ),
    1467             'date_added'    => current_time('mysql'),
    1468             'page_id'        => self::$page_id,
    1469             'request_status' => self::db_truncate_field(self::current_request_status($response), 20),
    1470             'request_group'  => self::db_truncate_field(self::current_request_group($args), 20),
     1498            'url' => $url,
     1499            'request_args' => self::json_encode($args),
     1500            'response' => self::json_encode($arr_response),
     1501            'runtime' => ( microtime(true) - $this->start_time ),
     1502            'date_added' => current_time('mysql'),
     1503            'page_id' => self::$page_id,
     1504            'request_status' => self::db_truncate_field(self::current_request_status($arr_response), 20),
     1505            'request_group' => self::db_truncate_field(self::current_request_group($args), 20),
    14711506            'request_source' => self::db_truncate_field(self::current_request_source($args), 255),
    14721507        ]);
     
    14811516    }
    14821517
     1518    static public function wp_send_json($data)
     1519    {
     1520        if(version_compare(self::wp_version(), '5.6') == -1)
     1521        {
     1522            return wp_send_json($data, null);
     1523        }
     1524
     1525        return wp_send_json($data, null, self::json_flags());
     1526    }
     1527
     1528    static public function json_encode($data)
     1529    {
     1530        return json_encode($data, self::json_flags());
     1531    }
     1532
     1533    static private function wp_version()
     1534    {
     1535        static $wp_version;
     1536
     1537        if(!isset($wp_version))
     1538        {
     1539            require ABSPATH . WPINC . '/version.php';
     1540        }
     1541
     1542        return $wp_version;
     1543    }
     1544
     1545    static public function json_flags()
     1546    {
     1547        static $flags = null;
     1548        if(is_null($flags))
     1549        {
     1550            $flags = 0;
     1551            if(defined('JSON_UNESCAPED_SLASHES'))
     1552            {
     1553                $flags = $flags | JSON_UNESCAPED_SLASHES;
     1554            }
     1555            if(defined('JSON_UNESCAPED_UNICODE '))
     1556            {
     1557                $flags = $flags | JSON_UNESCAPED_UNICODE;
     1558            }
     1559            if(defined('JSON_NUMERIC_CHECK'))
     1560            {
     1561                $flags = $flags | JSON_NUMERIC_CHECK;
     1562            }
     1563        }
     1564
     1565        return $flags;
     1566    }
     1567
     1568    static public function json_reduce_slashes($data)
     1569    {
     1570        if(!empty($data))
     1571        {
     1572            // check if data json and has multiple slashes
     1573            if(is_string($data) && strpos($data, '\/') !== false)
     1574            {
     1575
     1576                // try to decode and encode recursively
     1577                $dec = json_decode($data, true);
     1578                if(json_last_error() === 0)
     1579                {
     1580                    // decoded
     1581                    $return = self::json_encode(self::json_reduce_slashes($dec));
     1582
     1583                    /*
     1584                     *
     1585                      static $total_before = 0;
     1586                      static $total_after = 0;
     1587
     1588                      $total_before += strlen($data);
     1589                      $total_after += strlen($return);
     1590
     1591                      echo '[found:' . substr($data, 0, 20)
     1592                      . '...(' . strlen($data)
     1593                      . ') ~ RESULT'
     1594                      . substr($return, 0, 20)
     1595                      . '...(' . strlen($return)
     1596                      . ')...(before-after:' . $total_before . '-' . $total_after . '='
     1597                      . (round(100 - $total_after * 100 / $total_before)) . ')]'
     1598                      . "\n";
     1599                     */
     1600
     1601                    return $return;
     1602                }
     1603
     1604                unset($dec);
     1605            }
     1606            elseif(is_array($data))
     1607            {
     1608                //echo '[arr:' . count($data) . ':' . implode(',', array_keys($data)) . ']' . "\n";
     1609
     1610                $new_data = array();
     1611                foreach($data as $key => $val)
     1612                {
     1613                    $new_data[$key] = self::json_reduce_slashes($val);
     1614                }
     1615                unset($data);
     1616                return $new_data;
     1617            }
     1618        }
     1619
     1620        // not processed
     1621        // not json (or not processed) return as is
     1622        return $data;
     1623    }
     1624
     1625    static public function obj2arr($obj)
     1626    {
     1627        // use this instead of (array) casting.
     1628        // because (array) converts private and protected properties which we do not need.
     1629        // json uses only public properties
     1630        return json_decode(self::json_encode($obj), true);
     1631    }
     1632
     1633    static public function trim_reponse_body(& $response)
     1634    {
     1635
     1636        // reduce response body
     1637        // convert obj to array
     1638        if(is_object($response))
     1639        {
     1640            $response = self::obj2arr($response);
     1641        }
     1642
     1643
     1644        if(!empty($response['body']) && is_string($response['body']) && strlen($response['body']) > self::DATA_TRUNCATE_LIMIT)
     1645        {
     1646            // remove slashes before cutting string
     1647            $response['body'] = self::json_reduce_slashes($response['body']);
     1648
     1649            // reduce response body
     1650            $response['body'] = substr($response['body'], 0, self::DATA_TRUNCATE_VALUE)
     1651                    . " ...[" . self::nice_bytes(strlen($response['body'])) . "]";
     1652
     1653            return true;
     1654        }
     1655
     1656        return false;
     1657    }
     1658
    14831659    /**
    14841660     * Update page record. called on shutdown and when new request added
     
    14941670
    14951671            $log_data = array(
    1496                 'runtime'    => self::timer_float(),
    1497                 'info'       => json_encode(self::append_page_info())
     1672                'runtime' => self::timer_float(),
     1673                'info' => self::json_encode(self::append_page_info())
    14981674            );
    14991675
     
    15161692            if(is_object($response))
    15171693            {
    1518                 $response = (array) $response;
     1694                $response = self::obj2arr($response);
    15191695            }
    15201696
     
    15931769        $tokens = array(
    15941770            31536000 => 'year',
    1595             2592000  => 'month',
    1596             604800  => 'week',
    1597             86400    => 'day',
    1598             3600    => 'hour',
    1599             60      => 'minute',
    1600             1        => 'second'
     1771            2592000 => 'month',
     1772            604800 => 'week',
     1773            86400 => 'day',
     1774            3600 => 'hour',
     1775            60 => 'minute',
     1776            1 => 'second'
    16011777        );
    16021778
     
    23632539
    23642540        $row = array(
    2365             'file'  => $file_short,
    2366             'type'  => 'core'
     2541            'file' => $file_short,
     2542            'type' => 'core'
    23672543        );
    23682544
     
    29443120
    29453121        $defaults = [
    2946             'page'          => 1,
    2947             'per_page'      => 100,
    2948             'orderby'        => 'date_added',
    2949             'order'          => 'DESC',
    2950             'search'        => '',
    2951             'get_domains'    => 0,
     3122            'page' => 1,
     3123            'per_page' => 100,
     3124            'orderby' => 'date_added',
     3125            'order' => 'DESC',
     3126            'search' => '',
     3127            'get_domains' => 0,
    29523128        ];
    29533129
     
    29553131
    29563132        $output = array(
    2957             'rows'  => array(),
    2958             'pages'  => array()
     3133            'rows' => array(),
     3134            'pages' => array()
    29593135        );
    29603136
     
    29943170
    29953171        $this->pager_args = array(
    2996             'page'          => $page,
    2997             'per_page'      => $per_page,
    2998             'total_rows'    => $total_rows,
    2999             'total_pages'    => $total_pages,
     3172            'page' => $page,
     3173            'per_page' => $per_page,
     3174            'total_rows' => $total_rows,
     3175            'total_pages' => $total_pages,
    30003176        );
    30013177
     
    30083184
    30093185            $row['status_code'] = '-';
     3186
    30103187            $response = json_decode($row['response'], true);
    30113188            if(!empty($response['response']['code']))
     
    30143191            }
    30153192
    3016             // reduce response if bigger than 10kb
    3017             if(isset($response['body']) && strlen($response['body']) > 10000)
    3018             {
    3019                 // reduce response body
    3020                 $response['body'] = substr($response['body'], 0, 10000)
    3021                         . " ...[" . self::nice_bytes(strlen($response['body'])) . "]";
    3022                 $row['response'] = json_encode($response);
    3023             }
     3193            if(self::trim_reponse_body($response))
     3194            {
     3195                // convert trimmed response back to json. if not trimmed then existing reponse already good to use and encoded.
     3196                $row['response'] = self::json_encode($response);
     3197            }
     3198
    30243199
    30253200            $row['runtime'] = round($row['runtime'], 3);
     
    30863261                $row['date_added'] = HTTP_Requests_Manager::time_since($row['date_added']);
    30873262
     3263                // remove requetss array from info
     3264                if(!empty($row['info']))
     3265                {
     3266                    $info = json_decode($row['info'], true);
     3267                    if(!empty($info['requests']))
     3268                    {
     3269                        unset($info['requests']);
     3270                        $row['info'] = self::json_encode($info);
     3271                    }
     3272                }
     3273
     3274
    30883275                // add with id for easy navigation inside js
    30893276                $output[$row['id']] = $row;
     
    32163403                $this->db_upgrade_run();
    32173404            }
     3405
     3406            // perform MU file upgrade
     3407            self::load_must_use_upgrade_check();
    32183408
    32193409            HTTP_Requests_Manager::update_option('version', $version);
  • http-requests-manager/tags/1.3.7/readme.txt

    r3178540 r3259801  
    44Tags: wp_http, log, debug, optimization, limit
    55Requires at least: 4.7
    6 Tested up to: 6.6
    7 Stable tag: 1.3.6
     6Tested up to: 6.7
     7Stable tag: 1.3.7
    88License: GPLv2
    99
     
    2020https://youtu.be/l_fvAnKPJkM
    2121
    22 [Check plugin overview on YouTube] (https://youtu.be/l_fvAnKPJkM) | [Watch plugin tutorials] (https://youtube.com/playlist?list=PLvn-qBzU0II7b5D4OYDnKpNpuvxiM0f4b)
     22[Check plugin overview on YouTube](https://youtu.be/l_fvAnKPJkM) | [Watch plugin tutorials](https://youtube.com/playlist?list=PLvn-qBzU0II7b5D4OYDnKpNpuvxiM0f4b)
    2323
    2424
     
    124124If you find this plugin useful to view WP_HTTP requests and speeding up your admin pages by blocking some requests then give good rating. Also check my other projects:
    125125
    126 * [Share button without plugin](https://veppa.com/share-button/) – add super fast native sharing button to your website. Tiny inline code, ad blocker safe, no external dependencies.
    127 * [bbPress WP Tweaks](https://veppa.com/bbpress-wp-tweaks/) – add custom sidebar, additional widgets and forum columns for sites powered with bbPress forum plugin.
    128 * [Tutorial to get high PageSpeed Score](https://veppa.com/share-button/) – video showing how I get PageSpeed Score 100 for my own website powered by WordPress CMS.
     126* [Tutorial to get high PageSpeed Score](https://veppa.com/improve-pagespeed/) — video showing how I get PageSpeed Score 100 for my own website powered by WordPress CMS.
     127* [Cloudflare Custom Rules](https://veppa.com/wordpress-cloudflare-optimization/) — pluginsless solutions for Page Cache, Antibot (prevents automated spam comments and brute-force login attacks) etc.
     128* [Share button without plugin](https://veppa.com/share-button/) — add super fast native sharing button to your website. Tiny inline code, ad blocker safe, no external dependencies.
     129* [bbPress WP Tweaks](https://veppa.com/bbpress-wp-tweaks/) — add custom sidebar, additional widgets and forum columns for sites powered with bbPress forum plugin.
    129130
    130131Visit veppa.com to learn from my [WordPress tutorials](https://veppa.com/category/learn-wordpress/).
     
    198199
    199200== Changelog ==
     201
     202
     203= 1.3.7 - 20 March 2025  =
     204
     205  * Fixed: Array type warning inside MU file.
     206  * Optimization: Truncate long responses. Reduce saved and reported data size by 50%. Average data for 100 requests after this optimization should be — uncompressed ~1mb, compressed ~100kb.
     207
    200208
    201209= 1.3.6 - 30 October 2024  =
  • http-requests-manager/tags/1.3.7/templates/page-settings.php

    r3178540 r3259801  
    182182                    <li><?php _e('Maximum 10 custom rules allowed. Please contact if you need more.', 'http-requests-manager'); ?></li>
    183183                </ol>
    184                
    185                 <p><b><a href="https://veppa.com/allow-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options#doc" target="_blank"><?php _e('Allow Request Tutorial', 'http-requests-manager') ?> →</a></b></p>
    186                 <p><b><a href="https://veppa.com/block-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options#doc" target="_blank"><?php _e('Block Request Tutorial', 'http-requests-manager') ?> →</a></b></p>
     184
     185
     186                <p><b><a href="https://veppa.com/allow-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank"><?php _e('Allow Request Tutorial', 'http-requests-manager') ?></a> | <a href="https://veppa.com/block-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank"><?php _e('Block Request Tutorial', 'http-requests-manager') ?></a></b></p>
    187187
    188188            </div>
     
    199199                    <?php
    200200                    $arr_group_view = array(
    201                         'group-no'              => 'no group',
    202                         'group-req-url'          => 'Group by request URL',
    203                         'group-req-domain'      => 'Group by request domain',
    204                         'group-page-url'        => 'Group by page URL',
    205                         'group-page-type'        => 'Group by page type',
    206                         'group-request-source'  => 'Group by initiator',
    207                         'group-request-group'    => 'Group by initiator type',
    208                         'group-response'        => 'Group by response'
     201                        'group-no' => 'no group',
     202                        'group-req-url' => 'Group by request URL',
     203                        'group-req-domain' => 'Group by request domain',
     204                        'group-page-url' => 'Group by page URL',
     205                        'group-page-type' => 'Group by page type',
     206                        'group-request-source' => 'Group by initiator',
     207                        'group-request-group' => 'Group by initiator type',
     208                        'group-response' => 'Group by response'
    209209                    );
    210210
     
    225225        <div class="vphrm-more-tools vphrm-panel">
    226226            <!-- more  -->
    227             <p>
     227            <p>             
     228                <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/improve-pagespeed/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
     229                    <span class="vphrm-card-val">▷</span>
     230                    <span class="vphrm-card-name"><b class="vphrm-card-h3">PageSpeed Score 100</b>
     231                        Video tutorial optimizing WordPress with 25 plugins, 2 external JS, YouTube video embeds.</span>
     232                </a>
     233
     234                <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/wordpress-cloudflare-optimization/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
     235                    <span class="vphrm-card-val">▩</span>
     236                    <span class="vphrm-card-name"><b class="vphrm-card-h3">Cloudflare Optimization Tutorials</b>
     237                        WordPress + Cloudflare: Page Cache, Bot Protection, SSL etc.</span>
     238                </a>
     239
    228240                <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/share-button/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
    229241                    <span class="vphrm-card-val">⦿</span>
     
    231243                        Fast load times, tiny code, no negative effect on Page Speed score. Free.</span>
    232244                </a>
    233                 <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/speed/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
    234                     <span class="vphrm-card-val">⪫</span>
    235                     <span class="vphrm-card-name"><b class="vphrm-card-h3">90+ PageSpeed</b>
    236                     Download PDF checklist that I use to get 90+ score on WordPress websites.</span>
    237                 </a>
    238                 <a class="vphrm-card vphrm-card-wide" href="https://youtu.be/W9wroFTw2mM" target="_blank">
    239                     <span class="vphrm-card-val">▷</span>
    240                     <span class="vphrm-card-name"><b class="vphrm-card-h3">PageSpeed Score 100</b>
    241                     Video tutorial optimizing WordPress with 25 plugins, 2 external JS, YouTube video embeds.</span>
    242                 </a>
    243245            </p>
    244246            <!-- more END  -->
     
    283285                    </a>
    284286                </p>
    285                
     287
    286288                <p><b><?php _e('Thank you!', 'http-requests-manager') ?></b></p>
    287289
  • http-requests-manager/trunk/a-http-requests-manager.php

    r3081974 r3259801  
    66  Author: veppa
    77  Author URI: https://veppa.com/
    8   Version: 1.0
     8  Version: 1.0.2
    99  Text Domain: http-requests-manager
    1010  Network: true
    11 
    12   Copyright (C) 2015-23 CERBER TECH INC., https://cerber.tech
    13   Copyright (C) 2015-23 Markov Gregory, https://wpcerber.com
    1411
    1512  Licenced under the GNU GPL.
     
    3633define('VPHRM_MODE_INIT', 1);
    3734
    38 if(in_array('http-requests-manager/http-requests-manager.php', apply_filters('active_plugins', get_option('active_plugins', array()))))
     35// make sure that we are in mu folder
     36if(str_replace("\\", "/", __DIR__) === str_replace("\\", "/", WPMU_PLUGIN_DIR))
    3937{
    40     // plugin active load it.
    41     if(( @include_once WP_PLUGIN_DIR . '/http-requests-manager/http-requests-manager.php' ) == true)
     38    $_vphrm_active_plugins = apply_filters('active_plugins', get_option('active_plugins', array()));
     39
     40    // include only if plugin active
     41    if(empty($_vphrm_active_plugins))
    4242    {
    43         define('VPHRM_MODE', 1);
     43        // no plugin is active. something wrong.
     44        // do nothing. it is temporaty state maybe when all plugins disabled.
     45        if(!file_exists(WP_PLUGIN_DIR . '/http-requests-manager/http-requests-manager.php'))
     46        {
     47            // main plugin file is not there remove this MU loader
     48            @unlink(__FILE__);
     49        }
     50    }
     51    elseif(is_array($_vphrm_active_plugins) && in_array('http-requests-manager/http-requests-manager.php', $_vphrm_active_plugins))
     52    {
     53        // plugin active load it.
     54        if(( @include_once WP_PLUGIN_DIR . '/http-requests-manager/http-requests-manager.php' ) == true)
     55        {
     56            define('VPHRM_MODE', 1);
     57        }
     58    }
     59    else
     60    {
     61        // only this plugin is not active
     62        // delete self because plugin is disabled without removing mu loader
     63        @unlink(__FILE__);
    4464    }
    4565}
    46 elseif(__DIR__ === WPMU_PLUGIN_DIR)
    47 {
    48     // delete self because plugin is disabled without removing mu loader
    49     @unlink(__FILE__);
    50 }
     66
     67
     68
  • http-requests-manager/trunk/http-requests-manager.php

    r3178540 r3259801  
    55  Plugin URI:   https://veppa.com/http-requests-manager/
    66  Description: Limit, Debug, Optimize WP_HTTP requests. Limit by request count, page load time, reduce timeout for each request. Speed up login and admin pages.
    7   Version: 1.3.6
     7  Version: 1.3.7
    88  Author: veppa
    99  Author URI: https://veppa.com/
     
    3030
    3131/**
     32 * 
    3233 * TODO:
    33  *
    3434  - add blocking by theme
    3535  - add blocking by core function
    36   - disable all enclosure checks and rely only on file extension
    3736  - safe-mode: show instruction about safe mode and operation mode on beginning. after dismissed move note to bottom.
    3837  - [maybe] group prevent enclosure checks and pingbacks. write 1 log instead of 50+
    39   - reduce ajax data. sometimes report loads slow. 230kb compressed = 1.3mb uncompressed
    40   - truncate long response,
    41   - remove duplicate info about requests in page array.
    4238  - optimization: define hooks only for selected mode and logging combination. define hooks granularly.
     39
     40 *
     41 * NOT POSSIBLE:
     42  -- disable all enclosure checks and rely only on file extension. (not possible, detection using ext done after getting positive response using WP_HTTP )
    4343  -------------------------------------------
    4444 * conflict test.
     
    7575class HTTP_Requests_Manager
    7676{
    77    
    78     const VERSION = '1.3.6';
     77
     78    const VERSION = '1.3.6.2';
    7979    const ID = 'http-requests-manager';
    8080    const TIMEOUT = 2;
     81    const DATA_TRUNCATE_LIMIT = 5000; // truncate response data if bigger than 6kb.  should always be (limit>=value)
     82    const DATA_TRUNCATE_VALUE = 3000; // truncate to 5kb. we do not need to see or store full (large) reponse.
    8183
    8284    public static $instance;
     
    216218    {
    217219        $arr_my_ajax_actions = array(
    218             'vphrm_query'                => true,
    219             'vphrm_clear'                => true,
    220             'vphrm_disable_logging'      => true,
    221             'vphrm_load_must_use'        => true,
    222             'vphrm_save_view'            => true,
    223             'vphrm_custom_rule_save'    => true,
    224             'vphrm_custom_rule_delete'  => true,
    225             'vphrm_mode'                => true,
    226             'vphrm_mode_change'          => true
     220            'vphrm_query' => true,
     221            'vphrm_clear' => true,
     222            'vphrm_disable_logging' => true,
     223            'vphrm_load_must_use' => true,
     224            'vphrm_save_view' => true,
     225            'vphrm_custom_rule_save' => true,
     226            'vphrm_custom_rule_delete' => true,
     227            'vphrm_mode' => true,
     228            'vphrm_mode_change' => true
    227229        );
    228230
     
    413415        $output['pager'] = $this->db_paginate();
    414416
    415         wp_send_json($output);
     417        //$output = self::json_reduce_slashes($output);
     418
     419        self::wp_send_json($output);
    416420    }
    417421
     
    431435
    432436        $output = [
    433             'mode'  => self::get_mode(),
    434             'modes'  => self::modes()
     437            'mode' => self::get_mode(),
     438            'modes' => self::modes()
    435439        ];
    436440
    437         wp_send_json($output);
     441        self::wp_send_json($output);
    438442    }
    439443
     
    460464
    461465
    462         wp_send_json($output);
     466        self::wp_send_json($output);
    463467    }
    464468
     
    483487
    484488
    485         wp_send_json($output);
     489        self::wp_send_json($output);
    486490    }
    487491
     
    649653    }
    650654
     655    /**
     656     * check if MU file has new version. upgrade file when necessary
     657     */
     658    private static function load_must_use_upgrade_check()
     659    {
     660        $src = VPHRM_DIR . self::$mu_plugin_file_name;
     661        $dest = WPMU_PLUGIN_DIR . self::$mu_plugin_file_name;
     662
     663        // is mu active
     664        if(file_exists($dest) && file_exists($src))
     665        {
     666            // get  versions           
     667            $src_info = get_file_data($src, array('Version' => 'Version'));
     668            $dest_info = get_file_data($dest, array('Version' => 'Version'));
     669
     670            // update if version different
     671            if(!empty($src_info['Version']) && !empty($dest_info['Version']) && $src_info['Version'] !== $dest_info['Version'])
     672            {
     673                // remove old mu file and set new one
     674                self::load_must_use_remove();
     675                self::load_must_use_set();
     676            }
     677        }
     678    }
     679
    651680    function vphrm_load_must_use()
    652681    {
     
    687716        }
    688717
    689         wp_send_json($output);
     718        self::wp_send_json($output);
    690719    }
    691720
     
    715744                    break;
    716745                default:
    717                     wp_send_json(array(
    718                         'status'    => 'error',
    719                         'message'    => __('Rule type is not valid', 'http-requests-manager')
     746                    self::wp_send_json(array(
     747                        'status' => 'error',
     748                        'message' => __('Rule type is not valid', 'http-requests-manager')
    720749                    ));
    721750                    return false;
     
    776805                    $output['message'] = sprintf(
    777806                            __('You have reached custom rule limit of %d. Please contact us if you need more custom rules.', 'http-requests-manager'),
    778           self::$custom_rules_limit
     807                            self::$custom_rules_limit
    779808                    );
    780809                }
     
    794823        }
    795824
    796         wp_send_json($output);
     825        self::wp_send_json($output);
    797826    }
    798827
     
    841870        }
    842871
    843         wp_send_json($output);
     872        self::wp_send_json($output);
    844873    }
    845874
     
    10641093        }
    10651094
    1066         wp_send_json($output);
     1095        self::wp_send_json($output);
    10671096    }
    10681097
     
    11541183    {
    11551184        $row = array(
    1156             'url'        => $url,
    1157             'runtime'    => round(microtime(true) - $this->start_time, 3),
     1185            'url' => $url,
     1186            'runtime' => round(microtime(true) - $this->start_time, 3),
    11581187            'total_time' => self::timer_float()
    11591188        );
     
    13491378        {
    13501379            self::$modes = array(
    1351                 'log'                    => __('Only log HTTP requests', 'http-requests-manager'),
    1352                 'log_all'                => __('Only log HTTP requests (+ cron requests)', 'http-requests-manager'),
    1353                 'block_smart'            => __('Smart block', 'http-requests-manager'),
    1354                 'block_external'        => __('Block external requests', 'http-requests-manager'),
    1355                 'block_external_no_wp'  => __('Block external requests (allow WordPress.org only)', 'http-requests-manager')
     1380                'log' => __('Only log HTTP requests', 'http-requests-manager'),
     1381                'log_all' => __('Only log HTTP requests (+ cron requests)', 'http-requests-manager'),
     1382                'block_smart' => __('Smart block', 'http-requests-manager'),
     1383                'block_external' => __('Block external requests', 'http-requests-manager'),
     1384                'block_external_no_wp' => __('Block external requests (allow WordPress.org only)', 'http-requests-manager')
    13561385            );
    13571386        }
     
    13831412        // False to ignore current row
    13841413        $log_data = apply_filters('vphrm_log_page_data', [
    1385             'url'        => self::page_url(),
    1386             'page_type'  => self::db_truncate_field(self::current_page_type(), 20),
    1387             'runtime'    => self::timer_float(),
    1388             'info'       => json_encode($info),
     1414            'url' => self::page_url(),
     1415            'page_type' => self::db_truncate_field(self::current_page_type(), 20),
     1416            'runtime' => self::timer_float(),
     1417            'info' => self::json_encode($info),
    13891418            'date_added' => current_time('mysql')
    13901419        ]);
     
    14591488         */
    14601489
     1490        // convert obj to array reponse to work simpler and without any private protected properties.
     1491        $arr_response = self::obj2arr($response);
     1492
     1493        // reduce response body
     1494        self::trim_reponse_body($arr_response);
     1495
    14611496        // False to ignore current row
    14621497        $log_data = apply_filters('vphrm_log_data', [
    1463             'url'            => $url,
    1464             'request_args'   => json_encode($args),
    1465             'response'       => json_encode($response),
    1466             'runtime'        => ( microtime(true) - $this->start_time ),
    1467             'date_added'    => current_time('mysql'),
    1468             'page_id'        => self::$page_id,
    1469             'request_status' => self::db_truncate_field(self::current_request_status($response), 20),
    1470             'request_group'  => self::db_truncate_field(self::current_request_group($args), 20),
     1498            'url' => $url,
     1499            'request_args' => self::json_encode($args),
     1500            'response' => self::json_encode($arr_response),
     1501            'runtime' => ( microtime(true) - $this->start_time ),
     1502            'date_added' => current_time('mysql'),
     1503            'page_id' => self::$page_id,
     1504            'request_status' => self::db_truncate_field(self::current_request_status($arr_response), 20),
     1505            'request_group' => self::db_truncate_field(self::current_request_group($args), 20),
    14711506            'request_source' => self::db_truncate_field(self::current_request_source($args), 255),
    14721507        ]);
     
    14811516    }
    14821517
     1518    static public function wp_send_json($data)
     1519    {
     1520        if(version_compare(self::wp_version(), '5.6') == -1)
     1521        {
     1522            return wp_send_json($data, null);
     1523        }
     1524
     1525        return wp_send_json($data, null, self::json_flags());
     1526    }
     1527
     1528    static public function json_encode($data)
     1529    {
     1530        return json_encode($data, self::json_flags());
     1531    }
     1532
     1533    static private function wp_version()
     1534    {
     1535        static $wp_version;
     1536
     1537        if(!isset($wp_version))
     1538        {
     1539            require ABSPATH . WPINC . '/version.php';
     1540        }
     1541
     1542        return $wp_version;
     1543    }
     1544
     1545    static public function json_flags()
     1546    {
     1547        static $flags = null;
     1548        if(is_null($flags))
     1549        {
     1550            $flags = 0;
     1551            if(defined('JSON_UNESCAPED_SLASHES'))
     1552            {
     1553                $flags = $flags | JSON_UNESCAPED_SLASHES;
     1554            }
     1555            if(defined('JSON_UNESCAPED_UNICODE '))
     1556            {
     1557                $flags = $flags | JSON_UNESCAPED_UNICODE;
     1558            }
     1559            if(defined('JSON_NUMERIC_CHECK'))
     1560            {
     1561                $flags = $flags | JSON_NUMERIC_CHECK;
     1562            }
     1563        }
     1564
     1565        return $flags;
     1566    }
     1567
     1568    static public function json_reduce_slashes($data)
     1569    {
     1570        if(!empty($data))
     1571        {
     1572            // check if data json and has multiple slashes
     1573            if(is_string($data) && strpos($data, '\/') !== false)
     1574            {
     1575
     1576                // try to decode and encode recursively
     1577                $dec = json_decode($data, true);
     1578                if(json_last_error() === 0)
     1579                {
     1580                    // decoded
     1581                    $return = self::json_encode(self::json_reduce_slashes($dec));
     1582
     1583                    /*
     1584                     *
     1585                      static $total_before = 0;
     1586                      static $total_after = 0;
     1587
     1588                      $total_before += strlen($data);
     1589                      $total_after += strlen($return);
     1590
     1591                      echo '[found:' . substr($data, 0, 20)
     1592                      . '...(' . strlen($data)
     1593                      . ') ~ RESULT'
     1594                      . substr($return, 0, 20)
     1595                      . '...(' . strlen($return)
     1596                      . ')...(before-after:' . $total_before . '-' . $total_after . '='
     1597                      . (round(100 - $total_after * 100 / $total_before)) . ')]'
     1598                      . "\n";
     1599                     */
     1600
     1601                    return $return;
     1602                }
     1603
     1604                unset($dec);
     1605            }
     1606            elseif(is_array($data))
     1607            {
     1608                //echo '[arr:' . count($data) . ':' . implode(',', array_keys($data)) . ']' . "\n";
     1609
     1610                $new_data = array();
     1611                foreach($data as $key => $val)
     1612                {
     1613                    $new_data[$key] = self::json_reduce_slashes($val);
     1614                }
     1615                unset($data);
     1616                return $new_data;
     1617            }
     1618        }
     1619
     1620        // not processed
     1621        // not json (or not processed) return as is
     1622        return $data;
     1623    }
     1624
     1625    static public function obj2arr($obj)
     1626    {
     1627        // use this instead of (array) casting.
     1628        // because (array) converts private and protected properties which we do not need.
     1629        // json uses only public properties
     1630        return json_decode(self::json_encode($obj), true);
     1631    }
     1632
     1633    static public function trim_reponse_body(& $response)
     1634    {
     1635
     1636        // reduce response body
     1637        // convert obj to array
     1638        if(is_object($response))
     1639        {
     1640            $response = self::obj2arr($response);
     1641        }
     1642
     1643
     1644        if(!empty($response['body']) && is_string($response['body']) && strlen($response['body']) > self::DATA_TRUNCATE_LIMIT)
     1645        {
     1646            // remove slashes before cutting string
     1647            $response['body'] = self::json_reduce_slashes($response['body']);
     1648
     1649            // reduce response body
     1650            $response['body'] = substr($response['body'], 0, self::DATA_TRUNCATE_VALUE)
     1651                    . " ...[" . self::nice_bytes(strlen($response['body'])) . "]";
     1652
     1653            return true;
     1654        }
     1655
     1656        return false;
     1657    }
     1658
    14831659    /**
    14841660     * Update page record. called on shutdown and when new request added
     
    14941670
    14951671            $log_data = array(
    1496                 'runtime'    => self::timer_float(),
    1497                 'info'       => json_encode(self::append_page_info())
     1672                'runtime' => self::timer_float(),
     1673                'info' => self::json_encode(self::append_page_info())
    14981674            );
    14991675
     
    15161692            if(is_object($response))
    15171693            {
    1518                 $response = (array) $response;
     1694                $response = self::obj2arr($response);
    15191695            }
    15201696
     
    15931769        $tokens = array(
    15941770            31536000 => 'year',
    1595             2592000  => 'month',
    1596             604800  => 'week',
    1597             86400    => 'day',
    1598             3600    => 'hour',
    1599             60      => 'minute',
    1600             1        => 'second'
     1771            2592000 => 'month',
     1772            604800 => 'week',
     1773            86400 => 'day',
     1774            3600 => 'hour',
     1775            60 => 'minute',
     1776            1 => 'second'
    16011777        );
    16021778
     
    23632539
    23642540        $row = array(
    2365             'file'  => $file_short,
    2366             'type'  => 'core'
     2541            'file' => $file_short,
     2542            'type' => 'core'
    23672543        );
    23682544
     
    29443120
    29453121        $defaults = [
    2946             'page'          => 1,
    2947             'per_page'      => 100,
    2948             'orderby'        => 'date_added',
    2949             'order'          => 'DESC',
    2950             'search'        => '',
    2951             'get_domains'    => 0,
     3122            'page' => 1,
     3123            'per_page' => 100,
     3124            'orderby' => 'date_added',
     3125            'order' => 'DESC',
     3126            'search' => '',
     3127            'get_domains' => 0,
    29523128        ];
    29533129
     
    29553131
    29563132        $output = array(
    2957             'rows'  => array(),
    2958             'pages'  => array()
     3133            'rows' => array(),
     3134            'pages' => array()
    29593135        );
    29603136
     
    29943170
    29953171        $this->pager_args = array(
    2996             'page'          => $page,
    2997             'per_page'      => $per_page,
    2998             'total_rows'    => $total_rows,
    2999             'total_pages'    => $total_pages,
     3172            'page' => $page,
     3173            'per_page' => $per_page,
     3174            'total_rows' => $total_rows,
     3175            'total_pages' => $total_pages,
    30003176        );
    30013177
     
    30083184
    30093185            $row['status_code'] = '-';
     3186
    30103187            $response = json_decode($row['response'], true);
    30113188            if(!empty($response['response']['code']))
     
    30143191            }
    30153192
    3016             // reduce response if bigger than 10kb
    3017             if(isset($response['body']) && strlen($response['body']) > 10000)
    3018             {
    3019                 // reduce response body
    3020                 $response['body'] = substr($response['body'], 0, 10000)
    3021                         . " ...[" . self::nice_bytes(strlen($response['body'])) . "]";
    3022                 $row['response'] = json_encode($response);
    3023             }
     3193            if(self::trim_reponse_body($response))
     3194            {
     3195                // convert trimmed response back to json. if not trimmed then existing reponse already good to use and encoded.
     3196                $row['response'] = self::json_encode($response);
     3197            }
     3198
    30243199
    30253200            $row['runtime'] = round($row['runtime'], 3);
     
    30863261                $row['date_added'] = HTTP_Requests_Manager::time_since($row['date_added']);
    30873262
     3263                // remove requetss array from info
     3264                if(!empty($row['info']))
     3265                {
     3266                    $info = json_decode($row['info'], true);
     3267                    if(!empty($info['requests']))
     3268                    {
     3269                        unset($info['requests']);
     3270                        $row['info'] = self::json_encode($info);
     3271                    }
     3272                }
     3273
     3274
    30883275                // add with id for easy navigation inside js
    30893276                $output[$row['id']] = $row;
     
    32163403                $this->db_upgrade_run();
    32173404            }
     3405
     3406            // perform MU file upgrade
     3407            self::load_must_use_upgrade_check();
    32183408
    32193409            HTTP_Requests_Manager::update_option('version', $version);
  • http-requests-manager/trunk/readme.txt

    r3178540 r3259801  
    44Tags: wp_http, log, debug, optimization, limit
    55Requires at least: 4.7
    6 Tested up to: 6.6
    7 Stable tag: 1.3.6
     6Tested up to: 6.7
     7Stable tag: 1.3.7
    88License: GPLv2
    99
     
    2020https://youtu.be/l_fvAnKPJkM
    2121
    22 [Check plugin overview on YouTube] (https://youtu.be/l_fvAnKPJkM) | [Watch plugin tutorials] (https://youtube.com/playlist?list=PLvn-qBzU0II7b5D4OYDnKpNpuvxiM0f4b)
     22[Check plugin overview on YouTube](https://youtu.be/l_fvAnKPJkM) | [Watch plugin tutorials](https://youtube.com/playlist?list=PLvn-qBzU0II7b5D4OYDnKpNpuvxiM0f4b)
    2323
    2424
     
    124124If you find this plugin useful to view WP_HTTP requests and speeding up your admin pages by blocking some requests then give good rating. Also check my other projects:
    125125
    126 * [Share button without plugin](https://veppa.com/share-button/) – add super fast native sharing button to your website. Tiny inline code, ad blocker safe, no external dependencies.
    127 * [bbPress WP Tweaks](https://veppa.com/bbpress-wp-tweaks/) – add custom sidebar, additional widgets and forum columns for sites powered with bbPress forum plugin.
    128 * [Tutorial to get high PageSpeed Score](https://veppa.com/share-button/) – video showing how I get PageSpeed Score 100 for my own website powered by WordPress CMS.
     126* [Tutorial to get high PageSpeed Score](https://veppa.com/improve-pagespeed/) — video showing how I get PageSpeed Score 100 for my own website powered by WordPress CMS.
     127* [Cloudflare Custom Rules](https://veppa.com/wordpress-cloudflare-optimization/) — pluginsless solutions for Page Cache, Antibot (prevents automated spam comments and brute-force login attacks) etc.
     128* [Share button without plugin](https://veppa.com/share-button/) — add super fast native sharing button to your website. Tiny inline code, ad blocker safe, no external dependencies.
     129* [bbPress WP Tweaks](https://veppa.com/bbpress-wp-tweaks/) — add custom sidebar, additional widgets and forum columns for sites powered with bbPress forum plugin.
    129130
    130131Visit veppa.com to learn from my [WordPress tutorials](https://veppa.com/category/learn-wordpress/).
     
    198199
    199200== Changelog ==
     201
     202
     203= 1.3.7 - 20 March 2025  =
     204
     205  * Fixed: Array type warning inside MU file.
     206  * Optimization: Truncate long responses. Reduce saved and reported data size by 50%. Average data for 100 requests after this optimization should be — uncompressed ~1mb, compressed ~100kb.
     207
    200208
    201209= 1.3.6 - 30 October 2024  =
  • http-requests-manager/trunk/templates/page-settings.php

    r3178540 r3259801  
    182182                    <li><?php _e('Maximum 10 custom rules allowed. Please contact if you need more.', 'http-requests-manager'); ?></li>
    183183                </ol>
    184                
    185                 <p><b><a href="https://veppa.com/allow-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options#doc" target="_blank"><?php _e('Allow Request Tutorial', 'http-requests-manager') ?> →</a></b></p>
    186                 <p><b><a href="https://veppa.com/block-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options#doc" target="_blank"><?php _e('Block Request Tutorial', 'http-requests-manager') ?> →</a></b></p>
     184
     185
     186                <p><b><a href="https://veppa.com/allow-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank"><?php _e('Allow Request Tutorial', 'http-requests-manager') ?></a> | <a href="https://veppa.com/block-wp_http-request/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank"><?php _e('Block Request Tutorial', 'http-requests-manager') ?></a></b></p>
    187187
    188188            </div>
     
    199199                    <?php
    200200                    $arr_group_view = array(
    201                         'group-no'              => 'no group',
    202                         'group-req-url'          => 'Group by request URL',
    203                         'group-req-domain'      => 'Group by request domain',
    204                         'group-page-url'        => 'Group by page URL',
    205                         'group-page-type'        => 'Group by page type',
    206                         'group-request-source'  => 'Group by initiator',
    207                         'group-request-group'    => 'Group by initiator type',
    208                         'group-response'        => 'Group by response'
     201                        'group-no' => 'no group',
     202                        'group-req-url' => 'Group by request URL',
     203                        'group-req-domain' => 'Group by request domain',
     204                        'group-page-url' => 'Group by page URL',
     205                        'group-page-type' => 'Group by page type',
     206                        'group-request-source' => 'Group by initiator',
     207                        'group-request-group' => 'Group by initiator type',
     208                        'group-response' => 'Group by response'
    209209                    );
    210210
     
    225225        <div class="vphrm-more-tools vphrm-panel">
    226226            <!-- more  -->
    227             <p>
     227            <p>             
     228                <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/improve-pagespeed/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
     229                    <span class="vphrm-card-val">▷</span>
     230                    <span class="vphrm-card-name"><b class="vphrm-card-h3">PageSpeed Score 100</b>
     231                        Video tutorial optimizing WordPress with 25 plugins, 2 external JS, YouTube video embeds.</span>
     232                </a>
     233
     234                <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/wordpress-cloudflare-optimization/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
     235                    <span class="vphrm-card-val">▩</span>
     236                    <span class="vphrm-card-name"><b class="vphrm-card-h3">Cloudflare Optimization Tutorials</b>
     237                        WordPress + Cloudflare: Page Cache, Bot Protection, SSL etc.</span>
     238                </a>
     239
    228240                <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/share-button/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
    229241                    <span class="vphrm-card-val">⦿</span>
     
    231243                        Fast load times, tiny code, no negative effect on Page Speed score. Free.</span>
    232244                </a>
    233                 <a class="vphrm-card vphrm-card-wide" href="https://veppa.com/speed/?utm_source=wp&utm_medium=plugin&utm_campaign=options" target="_blank">
    234                     <span class="vphrm-card-val">⪫</span>
    235                     <span class="vphrm-card-name"><b class="vphrm-card-h3">90+ PageSpeed</b>
    236                     Download PDF checklist that I use to get 90+ score on WordPress websites.</span>
    237                 </a>
    238                 <a class="vphrm-card vphrm-card-wide" href="https://youtu.be/W9wroFTw2mM" target="_blank">
    239                     <span class="vphrm-card-val">▷</span>
    240                     <span class="vphrm-card-name"><b class="vphrm-card-h3">PageSpeed Score 100</b>
    241                     Video tutorial optimizing WordPress with 25 plugins, 2 external JS, YouTube video embeds.</span>
    242                 </a>
    243245            </p>
    244246            <!-- more END  -->
     
    283285                    </a>
    284286                </p>
    285                
     287
    286288                <p><b><?php _e('Thank you!', 'http-requests-manager') ?></b></p>
    287289
Note: See TracChangeset for help on using the changeset viewer.