73% woo-points-manager

Code Review | WooCommerce Points Manager

WordPress plugin WooCommerce Points Manager scored73%from 54 tests.

About plugin

  • Plugin page: woo-points-manager
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9
  • WordPress version: 6.3.1
  • First release: Nov 6, 2018
  • Latest release: Nov 6, 2018
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: bonus369 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /487 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by WooCommerce Points Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.43 ▼5.64
Dashboard /wp-admin3.31 ▲0.0144.69 ▼7.39
Posts /wp-admin/edit.php3.36 ▲0.0146.77 ▼0.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0178.61 ▼19.46
Media Library /wp-admin/upload.php3.23 ▲0.0134.58 ▲0.06

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 30 new files
Database: 1 new table, 6 new options
New tables
wp_points_transaction
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Points Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.48 ▲0.211.66 ▼0.4241.11 ▼2.95
Dashboard /wp-admin2,209 ▲214.85 ▼0.07109.20 ▼5.0039.92 ▼8.32
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0339.40 ▲3.1736.11 ▲3.01
Add New Post /wp-admin/post-new.php1,542 ▲2318.39 ▼4.78648.53 ▲21.7855.35 ▲6.04
Media Library /wp-admin/upload.php1,385 ▼34.18 ▼0.0093.29 ▼7.1341.64 ▼0.91

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_points_transaction
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-points-manager/views/user-points-manager.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/woo-points-manager/views/user-extract.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/woo-points-manager/views/user-points-config.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-points-manager/views/meta-box-order-points.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-points-manager/views/cart-points.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/woo-points-manager/woocommerce-points-manager.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: points, woocommerce, manager

woo-points-manager/woocommerce-points-manager.php 85% from 13 tests

The main PHP script in "WooCommerce Points Manager" version 1.0.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-points-manager.php" instead of "woocommerce-points-manager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,349 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP121364811,042
PO File16175146
JavaScript220133
Markdown115028

PHP code Passed 2 tests

This is a very shot 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.26
Average class complexity16.17
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods65
▷ Static methods23.08%
▷ Public methods6193.85%
▷ Protected methods00.00%
▷ Private methods46.15%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants4
▷ Global constants4100.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
9 PNG files occupy 0.53MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/cap-5.PNG53.80KB25.66KB▼ 52.30%
assets/img/cap-8.PNG69.68KB33.99KB▼ 51.22%
assets/img/cap-2.PNG61.05KB28.72KB▼ 52.96%
assets/img/cap-3.PNG55.70KB24.19KB▼ 56.56%
assets/img/cap-4.PNG61.44KB26.74KB▼ 56.48%