80% coupon-reveal-button

Code Review | Coupon & Discount Code Reveal Button

WordPress plugin Coupon & Discount Code Reveal Button scored 80% from 54 tests.

About plugin

  • Plugin page: coupon-reveal-button
  • Plugin version: 1.2.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 21, 2018
  • Latest release: Oct 19, 2022
  • Number of updates: 33
  • Update frequency: every 48.0 days
  • Top authors: suplugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

4,000+ active / 65,460 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼3.22ms] Passed 4 tests

Analyzing server-side resources used by Coupon & Discount Code Reveal Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.38 ▲3.02
Dashboard /wp-admin3.49 ▲0.1947.07 ▼3.38
Posts /wp-admin/edit.php3.60 ▲0.2546.47 ▼2.82
Add New Post /wp-admin/post-new.php6.07 ▲0.1990.83 ▼8.56
Media Library /wp-admin/upload.php3.41 ▲0.1938.36 ▲1.87

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 20 new files
Database: 1 new table, 7 new options
New tables
wp_spbcta
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
spbcta_db_version
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Coupon & Discount Code Reveal Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲18813.53 ▼1.159.12 ▲7.3939.85 ▼0.04
Dashboard /wp-admin2,224 ▲394.89 ▼0.9293.57 ▼4.0277.60 ▲31.83
Posts /wp-admin/edit.php2,101 ▲122.00 ▼0.0135.09 ▼0.9928.89 ▼4.84
Add New Post /wp-admin/post-new.php1,527 ▼623.35 ▲0.37629.74 ▼19.7151.98 ▼2.25
Media Library /wp-admin/upload.php1,400 ▲124.14 ▼0.10102.09 ▼4.0264.45 ▲16.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_spbcta
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • spbcta_db_version

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: bonus code, discount code button, button, coupon button, reveal button

coupon-reveal-button/spbcta-plugin.php 92% from 13 tests

The main PHP script in "Coupon & Discount Code Reveal Button" version 1.2.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("coupon-reveal-button.php" instead of "spbcta-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,201 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP8194409933
JavaScript21716265
CSS2002
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity18.14
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods4685.19%
▷ Protected methods11.85%
▷ Private methods712.96%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
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
5 PNG files occupy 0.21MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin_notification/src/preview.png185.49KB59.75KB▼ 67.79%
img/p-design-1.png4.32KB2.07KB▼ 52.08%
img/p-design-2.png6.96KB3.30KB▼ 52.51%
img/icon.png15.67KB0.52KB▼ 96.68%
img/nofollow-img.png4.32KB2.15KB▼ 50.21%