84% force-refresh

Code Review | Force Refresh

WordPress plugin Force Refresh scored84%from 54 tests.

About plugin

  • Plugin page: force-refresh
  • Plugin version: 2.9.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.0
  • WordPress version: 6.3.1
  • First release: Oct 8, 2017
  • Latest release: Nov 17, 2023
  • Number of updates: 76
  • Update frequency: every 29.4 days
  • Top authors: jordanleven (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

4,000+ active /70,121 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.28MB] [CPU: ▲331.08ms] 75% from 4 tests

A check of server-side resources used by Force Refresh
It is recommended to improve the following
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 331.08ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2742.38 ▲0.68
Dashboard /wp-admin3.60 ▲0.26495.87 ▲434.13
Posts /wp-admin/edit.php3.65 ▲0.29519.15 ▲471.45
Add New Post /wp-admin/post-new.php6.23 ▲0.34527.13 ▲433.12
Media Library /wp-admin/upload.php3.55 ▲0.32489.35 ▲456.37

Server storage [IO: ▲0.83MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Force Refresh
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲16615.50 ▲1.3612.70 ▲10.8745.26 ▲0.51
Dashboard /wp-admin2,245 ▲656.36 ▲0.70133.73 ▲32.8545.91 ▲2.98
Posts /wp-admin/edit.php2,156 ▲563.53 ▲1.6060.45 ▲23.3140.96 ▲4.69
Add New Post /wp-admin/post-new.php6,280 ▲4,75427.37 ▲4.44853.14 ▲169.0951.14 ▼0.30
Media Library /wp-admin/upload.php1,453 ▲506.00 ▲1.70129.31 ▲29.5047.94 ▲4.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 27× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'JordanLeven\\Plugins\\ForceRefresh\\Api\\Api_Handler_Admin' not found in wp-content/plugins/force-refresh/includes/api/classes/class-api-handler-admin-refresh-site.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'JordanLeven\\Plugins\\ForceRefresh\\Api\\Api_Handler_Admin' not found in wp-content/plugins/force-refresh/includes/api/classes/class-api-handler-admin-options.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function JordanLeven\\Plugins\\ForceRefresh\\add_action() in wp-content/plugins/force-refresh/includes/actions/admin/inc.refresh-ui-meta-box.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function JordanLeven\\Plugins\\ForceRefresh\\add_action() in wp-content/plugins/force-refresh/includes/actions/admin/inc.refresh-ui.php:125
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/force-refresh/includes/actions/admin/inc.troubleshooting.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/force-refresh/includes/actions/admin/inc.release-notes.php on line 10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/force-refresh/includes/actions/admin/inc.troubleshooting.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function JordanLeven\\Plugins\\ForceRefresh\\add_action() in wp-content/plugins/force-refresh/includes/actions/admin/inc.refresh-ui.php:125
    • > PHP Fatal error
      Uncaught Error: Call to undefined function JordanLeven\\Plugins\\ForceRefresh\\add_action() in wp-content/plugins/force-refresh/includes/actions/admin/inc.roles.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function JordanLeven\\Plugins\\ForceRefresh\\Api\\add_action() in wp-content/plugins/force-refresh/includes/api/register-endpoints.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: refresh, single page application, reload

force-refresh/filter-force-refresh.php 92% from 13 tests

The main PHP script in "Force Refresh" version 2.9.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("force-refresh.php" instead of "filter-force-refresh.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,449 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP403751,1481,442
JSON1005
JavaScript2022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces2
Traits0
Classes16
▷ Abstract classes318.75%
▷ Concrete classes1381.25%
▷ Final classes00.00%
Methods83
▷ Static methods4250.60%
▷ Public methods7792.77%
▷ Protected methods00.00%
▷ Private methods67.23%
Functions32
▷ Named functions2578.12%
▷ Anonymous functions721.88%
Constants36
▷ Global constants1541.67%
▷ Class constants2158.33%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin