10% response-promotion-redeemer

Code Review | Response Promo Redeemer

WordPress plugin Response Promo Redeemer scored10%from 54 tests.

About plugin

  • Plugin page: response-promotio...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.2-3.4.1
  • WordPress version: 6.3.1
  • First release: May 9, 2012
  • Latest release: Aug 13, 2012
  • Number of updates: 48
  • Update frequency: every 2.1 days
  • Top authors: bielefeldt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,902 total downloads

Benchmarks

Plugin footprint 58% 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
  • Install procedure validation failed for this plugin
    • > Parse error in wp-content/plugins/response-promotion-redeemer/response-promo-redeemer.php+411
    syntax error, unexpected end of file

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

A check of server-side resources used by Response Promo Redeemer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.36 ▼7.34
Dashboard /wp-admin3.31 ▲0.0049.31 ▼5.15
Posts /wp-admin/edit.php3.36 ▲0.0048.02 ▲1.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.69 ▼20.61
Media Library /wp-admin/upload.php3.23 ▲0.0036.66 ▼1.01

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Response Promo Redeemer: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.001.99 ▲0.3143.96 ▼1.17
Dashboard /wp-admin2,192 ▲185.61 ▼0.0483.23 ▼5.2541.97 ▼2.86
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0137.15 ▲1.2832.44 ▼2.22
Add New Post /wp-admin/post-new.php1,526 ▼023.17 ▼0.43688.54 ▲6.4149.56 ▼6.01
Media Library /wp-admin/upload.php1,403 ▼04.15 ▲0.05100.35 ▼9.7847.07 ▲0.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/response-promotion-redeemer/includes/promo-codes.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/response-promotion-redeemer/includes/scripts.php:12
    • > WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE our_code = ''' at line 1 for query SELECT time_entered, partner_code, user_email, user_name FROM WHERE our_code = ''
    • > WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE our_code = ''' at line 1 for query SELECT COUNT(*) FROM WHERE our_code = ''
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/response-promotion-redeemer/includes/form-shortcodes.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/response-promotion-redeemer/includes/promo-ctype.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/response-promotion-redeemer/includes/display-functions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/response-promotion-redeemer/includes/csv-export.php:7
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/response-promotion-redeemer/response-promo-redeemer.php on line 411
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/response-promotion-redeemer/includes/admin-page.php:61
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/response-promotion-redeemer/includes/csv-export.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Response Promotion Redemption Options page), #2 (Response Promotion Redemption add/edit page), #3 (Response Promotion Redemption Query meta-box options), #4 (Response Promotion Redemption Redirect meta-box options)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === response-promotion-redeemer === )
You can take inspiration from this readme.txt

response-promotion-redeemer/response-promo-redeemer.php 85% from 13 tests

Analyzing the main PHP file in "Response Promo Redeemer" version 1.1.0
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 444 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("response-promotion-redeemer.php" instead of "response-promo-redeemer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,194 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10139112756
JavaScript366175386
CSS10052

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity11.00
▷ Minimum method complexity11.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods1100.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.81MB with 0.49MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png171.42KB63.50KB▼ 62.96%
screenshot-3.png85.77KB33.58KB▼ 60.84%
screenshot-2.png493.00KB195.12KB▼ 60.42%
screenshot-4.png75.87KB30.56KB▼ 59.72%