84% protocol-enforcer

Code Review | Protocol Enforcer

WordPress plugin Protocol Enforcer scored84%from 54 tests.

About plugin

  • Plugin page: protocol-enforcer
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.6
  • WordPress version: 6.3.1
  • First release: Jun 20, 2016
  • Latest release: Aug 11, 2016
  • Number of updates: 12
  • Update frequency: every 4.5 days
  • Top authors: Fastmover (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /570 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by Protocol Enforcer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.77 ▼6.81
Dashboard /wp-admin3.33 ▲0.0249.82 ▲4.29
Posts /wp-admin/edit.php3.38 ▲0.0246.72 ▼3.08
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.34 ▼9.50
Media Library /wp-admin/upload.php3.25 ▲0.0234.21 ▼1.22

Server storage [IO: ▲0.01MB] [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: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Protocol Enforcer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.54 ▼0.694.19 ▲2.3840.60 ▼2.19
Dashboard /wp-admin2,206 ▲154.83 ▼0.09112.09 ▲11.4242.41 ▲4.92
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0538.67 ▼1.4434.52 ▼4.32
Add New Post /wp-admin/post-new.php6,236 ▲4,72218.77 ▲1.26866.23 ▲206.3861.03 ▲9.50
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0793.39 ▼13.0544.29 ▼5.59

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/protocol-enforcer/protocol-enforcer.php:21

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: http, https

protocol-enforcer/protocol-enforcer.php 92% from 13 tests

This is the main PHP file of "Protocol Enforcer" version 0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin98 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1421198

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.79
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity7.80
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected