10% promo

Code Review | Promo

WordPress plugin Promo scored10%from 54 tests.

About plugin

  • Plugin page: promo
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 2, 2016
  • Latest release: Apr 4, 2018
  • Number of updates: 13
  • Update frequency: every 58.7 days
  • Top authors: promo.co (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,988 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Compile error in wp-content/plugins/promo/vendor/vierbergenlars/php-semver/src/vierbergenlars/SemVer/internal.php+7
    Cannot use vierbergenlars\LibJs\Object as Object because 'Object' is a special class name

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.45ms] Passed 4 tests

Server-side resources used by Promo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.84 ▼1.24
Dashboard /wp-admin3.31 ▲0.0046.48 ▼6.39
Posts /wp-admin/edit.php3.36 ▲0.0050.19 ▲1.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.01 ▼18.37
Media Library /wp-admin/upload.php3.23 ▲0.0035.50 ▼3.81

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 1,048 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Promo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.18 ▼0.811.65 ▼0.0144.53 ▲3.96
Dashboard /wp-admin2,209 ▲215.88 ▲0.03103.38 ▼6.2837.42 ▼8.31
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0541.77 ▲0.6936.65 ▲1.76
Add New Post /wp-admin/post-new.php1,533 ▲1923.10 ▲5.61659.69 ▼8.5870.38 ▲18.32
Media Library /wp-admin/upload.php1,391 ▲34.25 ▼0.0098.56 ▼14.9541.00 ▼6.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 516× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Debug\\ErrorHandler' not found in wp-content/plugins/promo/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Database\\ConnectionInterface' not found in wp-content/plugins/promo/vendor/illuminate/database/Connection.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/promo/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/promo/vendor/twig/twig/lib/Twig/Node/Module.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Database\\Query\\Processors\\Processor' not found in wp-content/plugins/promo/vendor/illuminate/database/Query/Processors/PostgresProcessor.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Finder\\Expression\\ValueInterface' not found in wp-content/plugins/promo/vendor/symfony/finder/Symfony/Component/Finder/Expression/Expression.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/promo/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\MessageCatalogueInterface' not found in wp-content/plugins/promo/vendor/symfony/translation/MessageCatalogue.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/promo/vendor/illuminate/support/Facades/Lang.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\ServiceProvider' not found in wp-content/plugins/promo/vendor/illuminate/support/AggregateServiceProvider.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Coming Soon), #2 (Coming Soon)
  • Plugin Name: Please specify the plugin name on the first line ( === promo === )
  • Tags: You are using too many tags: 20 tag instead of maximum 10
You can take inspiration from this readme.txt

promo/plugin.php 85% from 13 tests

The principal PHP file in "Promo" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("promo.php" instead of "plugin.php")
  • Description: The description should be shorter than 140 characters (currently 339 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin65,544 lines of code in 1,018 files:
LanguageFilesBlank linesComment linesLines of code
PHP85614,53243,55653,825
reStructuredText782,2411,9533,124
XSD392482,803
JSON22001,969
Markdown2469001,817
C22131821,015
XML10240247
Twig12180235
CSS271186
LESS1230153
YAML416169
C/C++ Header2192155
m42131246

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.01
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces121
Interfaces140
Traits7
Classes642
▷ Abstract classes457.01%
▷ Concrete classes59792.99%
▷ Final classes20.34%
Methods5,597
▷ Static methods58010.36%
▷ Public methods4,55081.29%
▷ Protected methods87215.58%
▷ Private methods1753.13%
Functions389
▷ Named functions19449.87%
▷ Anonymous functions19550.13%
Constants307
▷ Global constants4915.96%
▷ Class constants25884.04%
▷ Public constants258100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin