84% wprestapiextensions

Code Review | WPRestApiExtensions

WordPress plugin WPRestApiExtensions scored84%from 54 tests.

About plugin

  • Plugin page: wprestapiextensions
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 10, 2015
  • Latest release: Nov 11, 2015
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: larjen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /769 total downloads

Benchmarks

Plugin footprint 83% 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.62MB] [CPU: ▼15.64ms] Passed 4 tests

Server-side resources used by WPRestApiExtensions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.55 ▼0.42
Dashboard /wp-admin3.37 ▲0.0645.11 ▼2.40
Posts /wp-admin/edit.php3.48 ▲0.1246.03 ▲2.97
Add New Post /wp-admin/post-new.php3.24 ▼2.6437.96 ▼58.42
Media Library /wp-admin/upload.php3.29 ▲0.0634.29 ▼1.31
WPRestApiExtensions /wp-admin/tools.php?page=WPRestApiExtensionsAdmin3.2435.26

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
WPRestApiExtensions_MESSAGES
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPRestApiExtensions
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.18 ▼1.321.62 ▼0.3339.43 ▼5.50
Dashboard /wp-admin2,207 ▲195.84 ▲0.04100.17 ▼11.3039.47 ▼6.99
Posts /wp-admin/edit.php2,093 ▲12.00 ▼0.0438.98 ▼4.8736.99 ▲2.78
Add New Post /wp-admin/post-new.php1,536 ▲323.05 ▼0.25664.45 ▲24.6257.02 ▼1.04
Media Library /wp-admin/upload.php1,389 ▲44.22 ▲0.04105.14 ▲5.8246.04 ▼0.43
WPRestApiExtensions /wp-admin/tools.php?page=WPRestApiExtensionsAdmin8382.1924.7628.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 6× PHP files trigger server errors when accessed directly:
    • > http
      //wp.com/wp-json/wprestapiextensions/v1/post/?
    • > PHP Fatal error
      Uncaught Error: Class 'WPRestApiExtensions' not found in wp-content/plugins/wprestapiextensions/includes/admin.php:3
    • > http
      //wp.com/wp-json/wprestapiextensions/v1/tag/?
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wprestapiextensions/includes/main.php:388
    • > http
      //wp.com/wp-json/wprestapiextensions/v1/posts/?
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wprestapiextensions/includes/main.php:388

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: toggle

wprestapiextensions/WPRestApiExtensions.php 92% from 13 tests

The primary PHP file in "WPRestApiExtensions" version 1.0.6 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 ("wprestapiextensions.php" instead of "WPRestApiExtensions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected429 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8168129388
Markdown118041

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods19100.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions675.00%
▷ Anonymous functions225.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin