90% loyaltydog

Code Review | LoyaltyDog

WordPress plugin LoyaltyDog scored90%from 54 tests.

About plugin

  • Plugin page: loyaltydog
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Feb 10, 2017
  • Latest release: Jul 23, 2023
  • Number of updates: 74
  • Update frequency: every 31.8 days
  • Top authors: loyaltydog (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,833 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.96ms] Passed 4 tests

Server-side resources used by LoyaltyDog
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.83 ▼9.21
Dashboard /wp-admin3.34 ▼0.0152.61 ▼14.87
Posts /wp-admin/edit.php3.39 ▲0.0349.99 ▼1.95
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.78 ▼9.31
Media Library /wp-admin/upload.php3.26 ▲0.0335.47 ▼2.43

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 88 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
loyalty_dog_version
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for LoyaltyDog
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.28 ▼0.262.04 ▲0.3039.92 ▼4.91
Dashboard /wp-admin2,210 ▲365.52 ▼0.0683.28 ▼8.4640.18 ▼0.66
Posts /wp-admin/edit.php2,116 ▲162.02 ▼0.0144.90 ▲7.8033.17 ▼2.38
Add New Post /wp-admin/post-new.php1,543 ▲1723.05 ▼0.14679.76 ▲36.0960.20 ▲7.66
Media Library /wp-admin/upload.php1,412 ▲124.24 ▲0.0697.95 ▼4.6941.66 ▼3.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: woocommerce, points, offer, loyalty, ecommerce...

loyaltydog/loyaltydog.php Passed 13 tests

The main file in "LoyaltyDog" v. 1.1.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
79 characters long description:
LoyaltyDog - Digital Mobile Loyalty Program for On-Premise and Online Customers

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
Success! There were no dangerous files found in this plugin13,368 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript172,9557464,935
CSS9686863,058
Sass64601371,663
PHP164058571,527
HTML3345481,243
SVG100685
PO File17185190
JSON10036
Markdown127031

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.73
▷ Minimum class complexity2.00
▷ Maximum class complexity43.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods90
▷ Static methods1820.00%
▷ Public methods8291.11%
▷ Protected methods00.00%
▷ Private methods88.89%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.52MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/docs-en/images/PointsEarnedActions.png37.52KB9.62KB▼ 74.37%
assets/docs-en/images/LoyaltyDog-API.png21.37KB8.82KB▼ 58.74%
assets/docs-en/images/EasySignUp.png100.70KB32.66KB▼ 67.57%
assets/docs-en/images/Support-Portal.png101.57KB34.57KB▼ 65.96%
assets/docs-en/assets/css/images/bg.png34.97KB9.36KB▼ 73.23%