84% wp-simple-rest-api-authentication

Code Review | Simple REST API Authenticaton with WooCommerce Credentials

WordPress plugin Simple REST API Authenticaton with WooCommerce Credentials scored84%from 54 tests.

About plugin

  • Plugin page: wp-simple-rest-ap...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Jan 21, 2023
  • Latest release: Oct 31, 2023
  • Number of updates: 13
  • Update frequency: every 22.0 days
  • Top authors: oneteamsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /278 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.48ms] Passed 4 tests

Analyzing server-side resources used by Simple REST API Authenticaton with WooCommerce Credentials
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1238.36 ▼1.31
Dashboard /wp-admin3.49 ▲0.1444.68 ▼19.09
Posts /wp-admin/edit.php3.54 ▲0.1847.77 ▼1.10
Add New Post /wp-admin/post-new.php6.01 ▲0.1293.85 ▼0.41
Media Library /wp-admin/upload.php3.35 ▲0.1235.52 ▲2.54

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Simple REST API Authenticaton with WooCommerce Credentials
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.35 ▼0.001.79 ▼0.0441.05 ▼2.15
Dashboard /wp-admin2,206 ▲295.61 ▼0.1091.99 ▲0.2944.02 ▼7.71
Posts /wp-admin/edit.php2,111 ▲111.99 ▼0.0340.43 ▲4.9137.10 ▼1.03
Add New Post /wp-admin/post-new.php1,535 ▲723.62 ▲0.58597.24 ▼56.3757.71 ▼1.42
Media Library /wp-admin/upload.php1,414 ▲144.26 ▲0.1098.65 ▼1.5343.68 ▼1.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'OneTeamSoftware\\WP\\Admin\\Page\\AbstractPageTab' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/WP/Admin/Page/PageTab.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'OneTeamSoftware\\Mutex\\MutexInterface' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/Mutex/FileMutex.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function OneTeamSoftware\\WP\\SimpleRestApiAuthentication\\__() in wp-content/plugins/wp-simple-rest-api-authentication/wp-simple-rest-api-authentication.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'OneTeamSoftware\\WP\\Admin\\Page\\PageInterface' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/WP/Admin/Page/AbstractPageTab.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OneTeamSoftware\\Logger\\AbstractLogger' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/WC/Logger/Logger.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'OneTeamSoftware\\Logger\\LoggerInterface' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/Logger/AbstractLogger.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OneTeamSoftware\\Logger\\AbstractLogger' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/Logger/EchoLogger.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'OneTeamSoftware\\WP\\Admin\\Page\\PageInterface' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/WC/Admin/PageForm/AbstractPageForm.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'OneTeamSoftware\\WC\\Admin\\PageForm\\AbstractPageForm' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/WP/SimpleRestApiAuthentication/Admin/GeneralForm.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'OneTeamSoftware\\WP\\Admin\\Page\\PageInterface' not found in wp-content/plugins/wp-simple-rest-api-authentication/includes/WP/Admin/Page/AbstractPage.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-simple-rest-api-authentication/wp-simple-rest-api-authentication.php 92% from 13 tests

The main PHP file in "Simple REST API Authenticaton with WooCommerce Credentials" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 236 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected3,357 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP407581,9013,256
CSS6140101

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.59
▷ Minimum class complexity1.00
▷ Maximum class complexity115.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces17
Interfaces4
Traits0
Classes28
▷ Abstract classes414.29%
▷ Concrete classes2485.71%
▷ Final classes00.00%
Methods213
▷ Static methods219.86%
▷ Public methods15271.36%
▷ Protected methods2913.62%
▷ Private methods3215.02%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/1TeamSoftware-icon.png0.59KB0.75KB0.00%
assets/images/1TeamSoftware-logo.png14.55KB4.50KB▼ 69.05%