10% current-promotions-display

Code Review | Current Promotions Display

WordPress plugin Current Promotions Display scored10%from 54 tests.

About plugin

  • Plugin page: current-promotion...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.0
  • WordPress version: 6.3.1
  • First release: Apr 10, 2015
  • Latest release: May 12, 2020
  • Number of updates: 23
  • Update frequency: every 80.8 days
  • Top authors: bobcares_plugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,269 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/current-promotions-display/current_promotions_display.php+12
    Use of undefined constant CUSTOM_PLAN_POST_TYPE - assumed 'CUSTOM_PLAN_POST_TYPE' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.91MB] [CPU: ▼57.35ms] Passed 4 tests

A check of server-side resources used by Current Promotions Display
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.67 ▼37.83
Dashboard /wp-admin2.11 ▼1.245.82 ▼62.00
Posts /wp-admin/edit.php2.11 ▼1.256.04 ▼42.31
Add New Post /wp-admin/post-new.php2.11 ▼3.786.77 ▼87.25
Media Library /wp-admin/upload.php2.11 ▼1.126.59 ▼26.79
All Pages /wp-admin/edit.php?post_type=thankyou_page2.116.03
Add New /wp-admin/post-new.php?post_type=thankyou_page2.118.59

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Current Promotions Display
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.38 ▼0.251.74 ▼0.2144.20 ▲5.51
Dashboard /wp-admin2,225 ▲485.64 ▲0.0584.26 ▼18.1644.64 ▲1.13
Posts /wp-admin/edit.php2,130 ▲301.99 ▼0.0337.51 ▼1.2834.66 ▼2.11
Add New Post /wp-admin/post-new.php1,549 ▲1623.01 ▲0.13678.02 ▲27.0450.24 ▼5.46
Media Library /wp-admin/upload.php1,427 ▲274.29 ▲0.0897.03 ▼8.0149.61 ▲3.07
All Pages /wp-admin/edit.php?post_type=thankyou_page1,1001.9630.6929.56
Add New /wp-admin/post-new.php?post_type=thankyou_page2,2597.72175.1663.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/current-promotions-display/current_promotions_display.php+12
    Use of undefined constant CUSTOM_PLAN_POST_TYPE - assumed 'CUSTOM_PLAN_POST_TYPE' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=thankyou_page
    • > Warning in wp-content/plugins/current-promotions-display/current_promotions_display.php+12
    Use of undefined constant CUSTOM_PLAN_POST_TYPE - assumed 'CUSTOM_PLAN_POST_TYPE' (this will throw an Error in a future version of PHP)

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/current-promotions-display/promotionTemplate.php:7
    • > PHP Warning
      Use of undefined constant CUSTOM_PLAN_POST_TYPE - assumed 'CUSTOM_PLAN_POST_TYPE' (this will throw an Error in a future version of PHP) in wp-content/plugins/current-promotions-display/current_promotions_display.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/current-promotions-display/current_promotions_display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: promotions, thank you page, sell offers, plan promoter, promotion display...

current-promotions-display/current_promotions_display.php 85% from 13 tests

The main PHP script in "Current Promotions Display" version 1.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 261 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("current-promotions-display.php" instead of "current_promotions_display.php")

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
Everything looks great! No dangerous files found in this plugin152 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25397152

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin