83% business-rules

Code Review | Business rules for WordPress

WordPress plugin Business rules for WordPress scored 83% from 54 tests.

About plugin

  • Plugin page: business-rules
  • Plugin version: 0.1.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 6.3.1
  • First release: Jul 1, 2021
  • Latest release: Aug 31, 2021
  • Number of updates: 10
  • Update frequency: every 6.2 days
  • Top authors: engahmeds3ed (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 612 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 gracefully, with no errors

Server metrics [RAM: ▲2.00MB] [CPU: ▲14.20ms] Passed 4 tests

A check of server-side resources used by Business rules for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.47 ▲2.0157.58 ▲15.26
Dashboard /wp-admin5.30 ▲1.9959.58 ▲12.83
Posts /wp-admin/edit.php5.35 ▲1.9968.11 ▲18.10
Add New Post /wp-admin/post-new.php7.91 ▲2.02113.52 ▲10.62
Media Library /wp-admin/upload.php5.22 ▲1.9959.88 ▲23.99
Add New /wp-admin/post-new.php?post_type=rules5.2759.91
All Rules /wp-admin/edit.php?post_type=rules5.2653.46

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 450 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Business rules for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9913.26 ▼1.331.78 ▲0.0042.66 ▲3.66
Dashboard /wp-admin2,237 ▲464.88 ▼1.01110.98 ▼7.4243.17 ▼1.26
Posts /wp-admin/edit.php2,123 ▲312.06 ▲0.0242.10 ▲0.2634.15 ▼3.38
Add New Post /wp-admin/post-new.php1,548 ▲2917.58 ▼5.82615.92 ▼20.5049.12 ▼11.28
Media Library /wp-admin/upload.php1,419 ▲314.20 ▲0.0192.95 ▼17.7242.50 ▼5.11
Add New /wp-admin/post-new.php?post_type=rules1,7582.7051.4860.28
All Rules /wp-admin/edit.php?post_type=rules1,0812.0031.1628.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • 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 | 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 take a closer look at the following
  • 338× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Rules\\Core\\Admin\\Condition\\AbstractCondition' not found in wp-content/plugins/business-rules/src/Conditions/Frontend/IsMonth.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/business-rules/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/business-rules/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/business-rules/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/business-rules/vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'WP_Rules\\Dependencies\\League\\Container\\Argument\\RawArgumentInterface' not found in wp-content/plugins/business-rules/src/Dependencies/League/Container/Argument/RawArgument.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'WP_Rules\\Core\\Plugin\\EventManagement\\SubscriberInterface' not found in wp-content/plugins/business-rules/src/Core/Admin/Condition/AbstractCondition.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/business-rules/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/business-rules/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Rules\\Core\\Admin\\Condition\\AbstractCondition' not found in wp-content/plugins/business-rules/src/Conditions/Frontend/Is404.php:11

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: actions, business rules, conditions, wp rules, rules...

business-rules/wp-rules.php 77% from 13 tests

This is the main PHP file of "Business rules for WordPress" version 0.1.5, 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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("business-rules.php" instead of "wp-rules.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin17,602 lines of code in 415 files:
LanguageFilesBlank linesComment linesLines of code
PHP4003,78610,02316,364
JSON400506
Markdown31350440
YAML3303118
JavaScript3165114
CSS10059
HTML1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity4.79
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces53
Interfaces25
Traits6
Classes350
▷ Abstract classes144.00%
▷ Concrete classes33696.00%
▷ Final classes10.30%
Methods1,354
▷ Static methods735.39%
▷ Public methods76356.35%
▷ Protected methods47134.79%
▷ Private methods1208.86%
Functions50
▷ Named functions714.00%
▷ Anonymous functions4386.00%
Constants69
▷ Global constants811.59%
▷ Class constants6188.41%
▷ Public constants61100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin