84% api-cache-pro

Code Review | API Cache Pro

WordPress plugin API Cache Pro scored 84% from 54 tests.

About plugin

  • Plugin page: api-cache-pro
  • Plugin version: 0.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Sep 30, 2019
  • Latest release: Apr 19, 2022
  • Number of updates: 8
  • Update frequency: every 116.8 days
  • Top authors: bhubbard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 720 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▲3.28ms] Passed 4 tests

Server-side resources used by API Cache Pro
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4242.16 ▼1.59
Dashboard /wp-admin3.72 ▲0.4155.34 ▲4.28
Posts /wp-admin/edit.php3.77 ▲0.4159.67 ▲8.76
Add New Post /wp-admin/post-new.php6.24 ▲0.35110.38 ▲20.15
Media Library /wp-admin/upload.php3.58 ▲0.3438.40 ▲1.66

Server storage [IO: ▲0.07MB] [DB: ▲0.38MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by API Cache Pro
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.68 ▼0.571.87 ▲0.2641.57 ▲0.95
Dashboard /wp-admin2,206 ▼04.86 ▼0.02108.63 ▲0.2143.11 ▲6.49
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0442.12 ▲4.8736.56 ▲4.22
Add New Post /wp-admin/post-new.php1,535 ▲223.01 ▼0.11624.04 ▼78.1758.72 ▼5.97
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0897.73 ▼15.0641.66 ▼9.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Exception: Could not find /tmp/wordpress-tests-lib/includes/functions.php, have you run bin/install-wp-tests.sh ? in wp-content/plugins/api-cache-pro/tests/bootstrap.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/api-cache-pro/tests/test-files.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: api-cache-pro, cache, api

api-cache-pro/class-api-cache-pro.php 92% from 13 tests

The primary PHP file in "API Cache Pro" version 0.0.4 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("api-cache-pro.php" instead of "class-api-cache-pro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin670 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
Bourne Shell12111120

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity17.50
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin