72% qero-loyalty-program-for-your-store

Code Review | Qero - Loyalty Program for your store

WordPress plugin Qero - Loyalty Program for your store scored 72% from 54 tests.

About plugin

  • Plugin page: qero-loyalty-prog...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4.0
  • WordPress version: 6.3.1
  • First release: Oct 14, 2019
  • Latest release: Apr 2, 2020
  • Number of updates: 10
  • Update frequency: every 17.4 days
  • Top authors: qeroapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 794 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

A check of server-side resources used by Qero - Loyalty Program for your store
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.88 ▲2.60
Dashboard /wp-admin3.31 ▲0.0050.78 ▲3.54
Posts /wp-admin/edit.php3.36 ▲0.0044.53 ▼8.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.17 ▼7.43
Media Library /wp-admin/upload.php3.23 ▲0.0033.47 ▼0.59
Account /wp-admin/admin.php?page=qero-for-wp-account3.0023.64

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 68 new files
Database: 3 new tables, 8 new options
New tables
wp_qero_logs
wp_qero_discount_points
wp_qero_association
New WordPress options
can_compress_scripts
widget_recent-posts
qero_endpoint_
widget_theysaidso_widget
db_upgraded
qero_last_event_done
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Qero - Loyalty Program for your store
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲3613.25 ▼1.191.84 ▲0.0645.46 ▼2.41
Dashboard /wp-admin2,206 ▼04.85 ▼1.03113.06 ▲17.8142.19 ▲3.46
Posts /wp-admin/edit.php2,089 ▼32.06 ▲0.0334.13 ▼0.9634.42 ▲2.31
Add New Post /wp-admin/post-new.php1,514 ▼017.77 ▼0.03630.58 ▼37.2857.98 ▲3.04
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0298.40 ▼6.8945.42 ▼2.55
Account /wp-admin/admin.php?page=qero-for-wp-account280.440.093.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • qero_last_event_done
    • qero_endpoint_
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/qero-loyalty-program-for-your-store/public/partials/qero-for-wp-public-display.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/qero-loyalty-program-for-your-store/templates/plain/qero-invite-item-email.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Qero_For_Wp' not found in wp-content/plugins/qero-loyalty-program-for-your-store/admin/class-qero-for-wp-admin.php:25
    • > PHP Notice
      Undefined variable: email_heading in wp-content/plugins/qero-loyalty-program-for-your-store/templates/plain/qero-invite-item-email.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/qero-loyalty-program-for-your-store/templates/html/qero-invite-item-email.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/qero-loyalty-program-for-your-store/public/templates/thankyou/qero-for-wp-thankyou.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/qero-loyalty-program-for-your-store/public/templates/checkout/qero-for-wp-cart-points.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/qero-loyalty-program-for-your-store/emails/class-qero-invite-email.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=qero-for-wp-account
    • > Network (severe)
    wp-admin/admin.php?page=qero-for-wp-account - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

qero-loyalty-program-for-your-store/qero-for-wp.php 85% from 13 tests

The main PHP file in "Qero - Loyalty Program for your store" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("qero-loyalty-program-for-your-store.php" instead of "qero-for-wp.php")

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
Good job! No executable or dangerous file extensions detected5,131 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP307518882,903
JavaScript13222611,179
PO File2236304603
CSS46715421
SVG20025

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity23.58
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods163
▷ Static methods1911.66%
▷ Public methods14790.18%
▷ Protected methods10.61%
▷ Private methods159.20%
Functions15
▷ Named functions1280.00%
▷ Anonymous functions320.00%
Constants23
▷ Global constants626.09%
▷ Class constants1773.91%
▷ Public constants17100.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/_qerobutton.png2.92KB2.43KB▼ 16.95%
admin/assets/qero.png2.86KB1.26KB▼ 55.77%
admin/assets/logo_qero.png11.01KB3.58KB▼ 67.52%