83% publish-approval

Code Review | Publish approval

WordPress plugin Publish approval scored83%from 54 tests.

About plugin

  • Plugin page: publish-approval
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9
  • WordPress version: 6.3.1
  • First release: Jul 28, 2018
  • Latest release: Aug 3, 2018
  • Number of updates: 3
  • Update frequency: every 3.0 days
  • Top authors: evidentlycube (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,805 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.18MB] [CPU: ▼1.01ms] Passed 4 tests

Analyzing server-side resources used by Publish approval
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1442.12 ▲1.28
Dashboard /wp-admin3.53 ▲0.2351.33 ▼4.29
Posts /wp-admin/edit.php3.58 ▲0.2353.12 ▲7.27
Add New Post /wp-admin/post-new.php6.07 ▲0.1896.48 ▼2.97
Media Library /wp-admin/upload.php3.39 ▲0.1641.34 ▲1.93
Publish approval /wp-admin/options-general.php?page=publish-approval3.3835.53

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Publish approval
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.27 ▼0.451.93 ▲0.3741.67 ▲1.34
Dashboard /wp-admin2,203 ▲295.62 ▲0.0289.72 ▼10.5236.73 ▼11.52
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0339.00 ▲3.2535.88 ▲3.09
Add New Post /wp-admin/post-new.php1,533 ▼223.31 ▲4.96624.87 ▼27.2963.34 ▼8.20
Media Library /wp-admin/upload.php1,411 ▲84.20 ▼0.03100.82 ▲0.0643.90 ▲0.42
Publish approval /wp-admin/options-general.php?page=publish-approval1,0362.0623.3932.76

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function EC_PublishApproval\\add_action() in wp-content/plugins/publish-approval/ECPlugin.php:119
    • > PHP Fatal error
      Uncaught Error: Class 'EC_PublishApproval\\ApprovalTools' not found in wp-content/plugins/publish-approval/templates/admin-view.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 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
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #5 (Publish widget with post ready to be published or unapproved)
  • Screenshots: Please a description for screenshot #3 in publish-approval/assets to your readme.txt
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

publish-approval/index.php 92% from 13 tests

The primary PHP file in "Publish approval" version 1.1 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 ("publish-approval.php" instead of "index.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,004 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP1719747871
PO File1222866
JavaScript17035
CSS17032

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.82
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods70
▷ Static methods6694.29%
▷ Public methods5680.00%
▷ Protected methods00.00%
▷ Private methods1420.00%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.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
There were not PNG files found in your plugin