84% woorule

Code Review | WooRule

WordPress plugin WooRule scored84%from 54 tests.

About plugin

  • Plugin page: woorule
  • Plugin version: 3.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 21, 2018
  • Latest release: Oct 24, 2023
  • Number of updates: 47
  • Update frequency: every 43.5 days
  • Top authors: rulecom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /4,340 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.28MB] [CPU: ▼5.29ms] Passed 4 tests

Analyzing server-side resources used by WooRule
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2524.50 ▼13.95
Dashboard /wp-admin3.64 ▲0.3345.13 ▼3.06
Posts /wp-admin/edit.php3.69 ▲0.3346.08 ▲2.52
Add New Post /wp-admin/post-new.php6.16 ▲0.2784.67 ▼4.49
Media Library /wp-admin/upload.php3.50 ▲0.2734.40 ▲0.35

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WooRule
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,503 ▼25814.14 ▲0.000.45 ▼1.6416.39 ▼22.24
Dashboard /wp-admin2,244 ▲645.69 ▲0.0880.87 ▼5.3674.83 ▲32.85
Posts /wp-admin/edit.php2,155 ▲552.00 ▲0.0434.97 ▼2.2533.56 ▼3.72
Add New Post /wp-admin/post-new.php1,575 ▲4922.95 ▼0.14751.04 ▲92.6679.75 ▲26.15
Media Library /wp-admin/upload.php1,452 ▲524.13 ▼0.0792.56 ▼13.7984.63 ▲37.87

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

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'WOORULE_PATHinc/trait-woorule-logging.php' (include_path='.:/usr/share/php') in wp-content/plugins/woorule/inc/class-woorule.php on line 8
    • > PHP Warning
      Use of undefined constant WOORULE_PATH - assumed 'WOORULE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woorule/inc/class-woorule.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woorule/inc/class-woorule-alert.php:25
    • > PHP Fatal error
      Trait 'Woorule_Logging' not found in wp-content/plugins/woorule/inc/class-rulemailer-api.php on line 21
    • > PHP Fatal error
      Trait 'Woorule_Logging' not found in wp-content/plugins/woorule/inc/class-productalert-api.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/woorule/woorule.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woorule/inc/class-woorule-alert-shortcode.php:20
    • > PHP Warning
      require_once(WOORULE_PATHinc/trait-woorule-logging.php): failed to open stream: No such file or directory in wp-content/plugins/woorule/inc/class-woorule.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Requires php: Version format is invalid
You can look at the official readme.txt

woorule/woorule.php 92% from 13 tests

The primary PHP file in "WooRule" version 3.0.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin2,298 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP213449022,002
JavaScript4254107
Sass311058
CSS614345
SVG10043
XML10027
Markdown18016

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.43
▷ Minimum class complexity3.00
▷ Maximum class complexity25.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods87
▷ Static methods2427.59%
▷ Public methods5462.07%
▷ Protected methods2326.44%
▷ Private methods1011.49%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/logo.png13.21KB6.03KB▼ 54.32%