84% promotator

Code Review | Promotator

WordPress plugin Promotator scored84%from 54 tests.

About plugin

  • Plugin page: promotator
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 12, 2017
  • Latest release: May 22, 2020
  • Number of updates: 4
  • Update frequency: every 269.0 days
  • Top authors: GeroNikolov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /750 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.00MB] [CPU: ▼10.53ms] Passed 4 tests

Analyzing server-side resources used by Promotator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.00 ▼4.80
Dashboard /wp-admin3.31 ▼0.0344.61 ▼16.91
Posts /wp-admin/edit.php3.37 ▲0.0145.88 ▼1.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.75 ▼19.10
Media Library /wp-admin/upload.php3.24 ▲0.0135.23 ▼1.07

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Promotator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲7413.26 ▼1.094.36 ▲2.3442.19 ▼1.87
Dashboard /wp-admin2,223 ▲385.78 ▼0.03105.19 ▲3.9438.69 ▲0.76
Posts /wp-admin/edit.php2,112 ▲202.03 ▲0.0438.50 ▼3.8035.56 ▼4.00
Add New Post /wp-admin/post-new.php1,531 ▲1723.17 ▲5.61660.08 ▲25.1054.08 ▲6.19
Media Library /wp-admin/upload.php1,405 ▲234.28 ▲0.06104.34 ▲5.5944.83 ▲2.16

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

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
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'roles' of non-object in wp-content/plugins/promotator/pages/dashboard.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/promotator/pages/dashboard.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/promotator/promotator.php:14
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/promotator/pages/dashboard.php on line 12

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

readme.txt 94% 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
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === promotator === )
The official readme.txt might help

promotator/promotator.php Passed 13 tests

The main file in "Promotator" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
121 characters long description:
This plugin will help you to make mass mailings to a specific user group with a specific template including unique posts!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected446 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP32814142
Sass113089
HTML20486
CSS11170
JavaScript16059

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected