10% wprestcache

Code Review | WPRestCache

WordPress plugin WPRestCache scored10%from 54 tests.

About plugin

  • Plugin page: wprestcache
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 17, 2015
  • Latest release: Nov 17, 2015
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: larjen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /516 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'WPRestApiExtensions' not found

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.77ms] Passed 4 tests

Analyzing server-side resources used by WPRestCache
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.55 ▼5.28
Dashboard /wp-admin3.34 ▼0.0149.63 ▼15.04
Posts /wp-admin/edit.php3.39 ▲0.0350.55 ▲0.32
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.57 ▲0.91
Media Library /wp-admin/upload.php3.26 ▲0.0337.73 ▲1.55
WPRestCache /wp-admin/tools.php?page=WPRestCacheAdmin3.2132.85

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
WPRestCache_MESSAGES
widget_recent-comments

Browser metrics Passed 4 tests

WPRestCache: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3614.24 ▲0.051.75 ▼0.2145.87 ▲6.93
Dashboard /wp-admin2,202 ▲275.63 ▲0.0380.94 ▼24.9138.18 ▼6.01
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0536.15 ▼2.5334.49 ▲1.47
Add New Post /wp-admin/post-new.php1,540 ▲618.27 ▼4.76621.69 ▼63.6371.96 ▲13.93
Media Library /wp-admin/upload.php1,401 ▲44.23 ▲0.04103.88 ▼0.6747.63 ▲2.97
WPRestCache /wp-admin/tools.php?page=WPRestCacheAdmin8352.0128.2033.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'WPRestApiExtensions' not found
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • WPRestCache_MESSAGES
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WPRestCache' not found in wp-content/plugins/wprestcache/includes/admin.php:3
    • > PHP Warning
      Use of undefined constant PATH_TO_WP - assumed 'PATH_TO_WP' (this will throw an Error in a future version of PHP) in wp-content/plugins/wprestcache/includes/rest-api/index.php on line 46
    • > PHP Warning
      Use of undefined constant PATH_TO_WP - assumed 'PATH_TO_WP' (this will throw an Error in a future version of PHP) in wp-content/plugins/wprestcache/includes/rest-api/index.php on line 46
    • > PHP Warning
      Use of undefined constant PATH_TO_WP - assumed 'PATH_TO_WP' (this will throw an Error in a future version of PHP) in wp-content/plugins/wprestcache/includes/rest-api/index.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wprestcache/includes/main.php:146
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wprestcache/includes/main.php:146

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: toggle

wprestcache/WPRestCache.php 92% from 13 tests

The entry point to "WPRestCache" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wprestcache.php" instead of "WPRestCache.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected262 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP810087235
Markdown110027

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods12100.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin