68% woo-points

Code Review | Woo Points

WordPress plugin Woo Points scored 68% from 54 tests.

About plugin

  • Plugin page: woo-points
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 30, 2017
  • Latest release: Mar 17, 2023
  • Number of updates: 7
  • Update frequency: every 272.0 days
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,227 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.30MB] [CPU: ▼1.65ms] Passed 4 tests

A check of server-side resources used by Woo Points
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3139.95 ▼1.32
Dashboard /wp-admin3.60 ▲0.2947.33 ▼2.60
Posts /wp-admin/edit.php3.71 ▲0.3552.24 ▲5.80
Add New Post /wp-admin/post-new.php6.20 ▲0.3187.46 ▼8.47
Media Library /wp-admin/upload.php3.52 ▲0.2946.39 ▲14.05
Options /wp-admin/admin.php?page=woopoints-admin-options3.4933.42
Woocommerce Points /wp-admin/admin.php?page=woopoints3.5037.95
Notifications /wp-admin/admin.php?page=woopoints-admin-notifications3.4934.30

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo Points
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲8313.24 ▼1.141.65 ▼0.3638.90 ▼11.53
Dashboard /wp-admin2,242 ▲574.89 ▼1.00100.20 ▼8.9386.64 ▲45.35
Posts /wp-admin/edit.php2,131 ▲422.06 ▲0.0439.14 ▲0.8935.15 ▲0.48
Add New Post /wp-admin/post-new.php1,699 ▲17122.10 ▲3.96728.34 ▲72.8660.19 ▲2.34
Media Library /wp-admin/upload.php1,424 ▲364.25 ▲0.06117.90 ▲12.2146.19 ▲1.74
Options /wp-admin/admin.php?page=woopoints-admin-options8681.7931.5427.22
Woocommerce Points /wp-admin/admin.php?page=woopoints1,0881.7729.3127.35
Notifications /wp-admin/admin.php?page=woopoints-admin-notifications8741.7326.1026.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_woo_points_users
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_woopoints_widget
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-points/lib/core/class-woo-points-table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-points/lib/core/class-woo-points-woocommerce-views.php:30
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-points/lib/core/class-woo-points-table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-points/lib/core/class-woo-points-notifications.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woo-points/woo-points.php:33
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/woo-points/lib/core/class-woo-points-table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woo-points/lib/core/class-woo-points-shortcodes.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-points/lib/core/class-woo-points-woocommerce.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/woo-points/lib/core/class-woo-points-widget.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woopoints-admin-notifications
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).datetimepicker is not a function" "TypeError: jQuery(...).datetimepicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/woo-points/js/admin-scripts.js?ver=1.0:3:28)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woopoints-admin-notifications
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).datetimepicker is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Options - you can adjust the plugin's settings here.), #2 (WooPoints - Admin the Woo Points from the dashboard.), #3 (Add manually - you can add points manually.), #4 (My Points - user frontend "my-points" section)
You can take inspiration from this readme.txt

woo-points/woo-points.php 92% from 13 tests

"Woo Points" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,259 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP113304511,558
CSS47519515
PO File16382152
JavaScript682924
XML10010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity23.00
▷ Minimum class complexity2.00
▷ Maximum class complexity69.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods70
▷ Static methods5477.14%
▷ Public methods6491.43%
▷ Protected methods45.71%
▷ Private methods22.86%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
5 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png33.28KB9.62KB▼ 71.10%
screenshot-2.png64.18KB17.71KB▼ 72.42%
screenshot-1.png24.94KB6.41KB▼ 74.32%
img/logo.png1.75KB1.48KB▼ 15.86%
screenshot-4.png48.92KB15.13KB▼ 69.07%