78% the-law

Code Review | The Law

WordPress plugin The Law scored78%from 54 tests.

About plugin

  • Plugin page: the-law
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6
  • WordPress version: 6.3.1
  • First release: Dec 29, 2013
  • Latest release: Dec 29, 2013
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: kennethrapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /795 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.35MB] [CPU: ▼20.27ms] Passed 4 tests

A check of server-side resources used by The Law
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0239.63 ▼1.97
Dashboard /wp-admin3.26 ▼0.0540.45 ▼9.59
Posts /wp-admin/edit.php3.29 ▼0.0742.62 ▼10.88
Add New Post /wp-admin/post-new.php4.60 ▼1.2844.28 ▼58.63
Media Library /wp-admin/upload.php3.23 ▲0.0036.51 ▲3.17

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for The Law
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.40 ▲0.142.44 ▲0.6144.31 ▼0.54
Dashboard /wp-admin2,195 ▲155.62 ▼0.0788.06 ▼6.1842.38 ▲3.89
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0442.20 ▲5.9635.97 ▼0.17
Add New Post /wp-admin/post-new.php1,526 ▼223.28 ▲0.08623.09 ▼76.7651.37 ▼2.47
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.06100.79 ▼1.7442.41 ▼3.50

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php
  • 34× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/the-law/vendor/htmlawed/htmlawed/htmLawedTest.php on line 538

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 93% from 29 tests

readme.txt Passed 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
3 plugin tags: xss protection, htmlawed, code whitelist

the-law/TheLaw.php 85% from 13 tests

The principal PHP file in "The Law" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("the-law.php" instead of "TheLaw.php")
  • Git Repository: Please do not include Git repositories in your plugin

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
Good job! No executable or dangerous file extensions detected3,383 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
HTML1228361,914
PHP81352081,393
JSON32057
Markdown110019

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.85
Average class complexity10.33
▷ Minimum class complexity5.00
▷ Maximum class complexity20.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods211.11%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.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 images were found in this plugin