94% wp-promotions

Code Review | WP Promotions

WordPress plugin WP Promotions scored 94% from 54 tests.

About plugin

  • Plugin page: wp-promotions
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.3
  • WordPress version: 5.8.1
  • First release: Sep 19, 2015
  • Latest release: Oct 15, 2015
  • Number of updates: 7
  • Update frequency: every 4.0 days
  • Top authors: mattg123 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 990 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼139.31ms] Passed 4 tests

This is a short check of server-side resources used by WP Promotions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.1142.18 ▲9.44
Dashboard /wp-admin3.17 ▲0.1154.51 ▲8.93
Posts /wp-admin/edit.php3.28 ▲0.1752.89 ▲6.24
Add New Post /wp-admin/post-new.php5.53 ▲0.0996.09 ▼573.86
Media Library /wp-admin/upload.php3.11 ▲0.1137.27 ▲1.45
Add New /wp-admin/post-new.php?post_type=promotion3.3057.74
All Promotions /wp-admin/edit.php?post_type=promotion3.1534.57
category /wp-admin/edit-tags.php?taxonomy=promotion_category&post_type=promotion3.1132.26

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Promotions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,869 ▲27316.36 ▲0.5020.87 ▲11.0849.98 ▲1.63
Dashboard /wp-admin3,025 ▲885.93 ▼0.02147.37 ▼20.17115.96 ▲6.34
Posts /wp-admin/edit.php2,794 ▲552.72 ▲0.0165.81 ▼8.06101.35 ▼35.76
Add New Post /wp-admin/post-new.php1,719 ▲3618.32 ▼0.39399.81 ▼38.52109.00 ▼6.16
Media Library /wp-admin/upload.php1,800 ▼75.04 ▲0.02179.63 ▲19.35120.88 ▲3.81
Add New /wp-admin/post-new.php?post_type=promotion3,4778.98276.40157.32
All Promotions /wp-admin/edit.php?post_type=promotion1,5112.6563.0879.98
category /wp-admin/edit-tags.php?taxonomy=promotion_category&post_type=promotion1,7942.3865.3280.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-promotions/shortcodes/promotion-profile.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpp_get_template_part() in wp-content/plugins/wp-promotions/templates/edit-promotion.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/wp-promotions/templates/signup.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-promotions/shortcodes/promotion-profile.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-promotions/functions/functions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpp_create_links() in wp-content/plugins/wp-promotions/templates/parts/main-menu.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-promotions/shortcodes/edit-promotion.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-promotions/shortcodes/view-promotion.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-promotions/shortcodes/submit-promotion.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpp_save_options() in wp-content/plugins/wp-promotions/admin/main-options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

wp-promotions/wp-promo.php 92% from 13 tests

The main PHP file in "WP Promotions" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-promotions.php" instead of "wp-promo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,306 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP22270151740
CSS24259465
JavaScript12010101

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
There are no PNG files in this plugin