83% ad5-loyalty

Code Review | WP LOYALTY by AD5

WordPress plugin WP LOYALTY by AD5 scored 83% from 54 tests.

About plugin

  • Plugin page: ad5-loyalty
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.2
  • WordPress version: 5.9.2
  • First release: Jan 12, 2018
  • Latest release: Jan 14, 2018
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: ad5admin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 537 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼297.88ms] Passed 4 tests

A check of server-side resources used by WP LOYALTY by AD5
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.1859.55 ▼20.57
Dashboard /wp-admin3.52 ▲0.1135.86 ▲0.19
Posts /wp-admin/edit.php3.75 ▲0.1140.77 ▲4.07
Add New Post /wp-admin/post-new.php7.02 ▲0.05100.85 ▼1,175.20
Media Library /wp-admin/upload.php3.40 ▲0.1033.72 ▲9.92

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP LOYALTY by AD5
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,004 ▲26215.91 ▲0.788.03 ▲0.712.52 ▲0.43
Dashboard /wp-admin2,922 ▲656.12 ▼0.08116.63 ▼12.52221.39 ▲23.54
Posts /wp-admin/edit.php2,717 ▲293.23 ▼0.0064.20 ▼2.23133.24 ▼8.97
Add New Post /wp-admin/post-new.php2,291 ▲53919.61 ▼2.09546.30 ▲81.23296.34 ▲64.00
Media Library /wp-admin/upload.php1,730 ▲365.53 ▲0.00136.40 ▼56.75188.55 ▼6.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 18 files (1.11MB) in the plugin directory
    • (new file) includes/class-ad5-loyalty-front.php
    • (new file) includes/class-ad5-loyalty-admin.php
    • (new file) languages/ad5-loyalty-ja.mo
    • (new file) includes/class-ad5-form.php
    • (new file) ad5-loyalty.php
    • (new file) readme.txt
    • (new file) languages/ad5-loyalty-ja.po
    • (new file) includes/class-ad5-auth.php
    • (new file) includes/class-ad5-user-manager.php
    • (new file) includes/class-ad5-colors.php
    • ...

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ad5-loyalty/template/modal.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ad5-loyalty/ad5-loyalty.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'AD5_Loyalty_Admin' not found in wp-content/plugins/ad5-loyalty/template/admin-docs.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'AD5_Loyalty_Admin' not found in wp-content/plugins/ad5-loyalty/template/admin-option.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

ad5-loyalty/ad5-loyalty.php 92% from 13 tests

The principal PHP file in "WP LOYALTY by AD5" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 184 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected1,500 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP101821561,395
PO File1540104
JavaScript1091

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity26.33
▷ Minimum class complexity5.00
▷ Maximum class complexity58.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods92
▷ Static methods55.43%
▷ Public methods8592.39%
▷ Protected methods00.00%
▷ Private methods77.61%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants25
▷ Global constants00.00%
▷ Class constants25100.00%
▷ Public constants25100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 1.02MB with 0.71MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png346.70KB103.57KB▼ 70.13%
screenshot-1.png144.55KB43.96KB▼ 69.59%
screenshot-3.png275.54KB85.52KB▼ 68.96%
screenshot-4.png277.90KB86.28KB▼ 68.95%