84% thekua-banner-for-offer-coupon

Code Review | Thekua - Banner for offer coupon

WordPress plugin Thekua - Banner for offer coupon scored 84% from 54 tests.

About plugin

  • Plugin page: thekua-banner-for...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 20, 2023
  • Latest release: Jul 24, 2023
  • Number of updates: 6
  • Update frequency: every 26.3 days
  • Top authors: devinlabsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 127 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.39ms] Passed 4 tests

A check of server-side resources used by Thekua - Banner for offer coupon
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0247.28 ▼19.27
Dashboard /wp-admin3.32 ▲0.0154.48 ▼3.33
Posts /wp-admin/edit.php3.37 ▲0.0156.32 ▲2.81
Add New Post /wp-admin/post-new.php5.90 ▲0.01132.02 ▲19.24
Media Library /wp-admin/upload.php3.24 ▲0.0149.82 ▲10.23

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Thekua - Banner for offer coupon: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲1914.56 ▲1.222.09 ▲0.03111.06 ▼17.73
Dashboard /wp-admin2,197 ▼15.79 ▲0.84185.49 ▼85.65134.37 ▼14.36
Posts /wp-admin/edit.php2,092 ▲242.05 ▲0.01121.45 ▲28.96364.78 ▲186.19
Add New Post /wp-admin/post-new.php1,401 ▼117.99 ▼0.041,019.43 ▲57.91123.79 ▼27.67
Media Library /wp-admin/upload.php1,382 ▲64.18 ▲0.07222.06 ▼18.66114.17 ▼170.89

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_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/thekua-banner-for-offer-coupon/frontend/thekua-customization.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/thekua-banner-for-offer-coupon/admin/adminSetting.php: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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: discount banner on checkout, offer, coupon banner on checkout, offer banner on cart, cart...

thekua-banner-for-offer-coupon/thekua-offercoupon.php 92% from 13 tests

The main PHP script in "Thekua - Banner for offer coupon" version 1.0.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("thekua-banner-for-offer-coupon.php" instead of "thekua-offercoupon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected101 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP42220101

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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