74% woopos-store-credit-points

Code Review | WooPOS Store Credit & Points

WordPress plugin WooPOS Store Credit & Points scored74%from 54 tests.

About plugin

  • Plugin page: woopos-store-cred...
  • Plugin version: 1.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: May 21, 2018
  • Latest release: Nov 9, 2021
  • Number of updates: 46
  • Update frequency: every 27.7 days
  • Top authors: woopos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,695 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
This plugin's installer ran successfully

Server metrics [RAM: ▼1.01MB] [CPU: ▼46.31ms] Passed 4 tests

Analyzing server-side resources used by WooPOS Store Credit & Points
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.96 ▼0.5015.24 ▼30.55
Dashboard /wp-admin3.00 ▼0.3117.82 ▼38.93
Posts /wp-admin/edit.php3.00 ▼0.3619.86 ▼30.98
Add New Post /wp-admin/post-new.php3.00 ▼2.8819.27 ▼84.76
Media Library /wp-admin/upload.php3.00 ▼0.2317.08 ▼21.05

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 12 new options
New WordPress options
woopos_credit_points_store_credit_message
woopos_credit_points_reward_points_not_zero_message
woopos_credit_points_reward_points_enable
woopos_credit_points_reward_points_zero_message
recovery_mode_email_last_sent
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooPOS Store Credit & Points
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,445 ▼31614.32 ▲0.080.50 ▼1.6318.89 ▼25.94
Dashboard /wp-admin2,195 ▲155.55 ▼0.0689.65 ▼11.0840.04 ▼5.49
Posts /wp-admin/edit.php45 ▼2,0550.42 ▼1.570.09 ▼40.6111.09 ▼29.05
Add New Post /wp-admin/post-new.php45 ▼1,4860.42 ▼22.630.09 ▼680.6712.45 ▼40.99
Media Library /wp-admin/upload.php1,400 ▼34.18 ▲0.0694.22 ▼19.6366.60 ▲18.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/woopos-store-credit-points/includes/class-woopos-credit-points-order-manager.php+22
    Use of undefined constant WC_VERSION - assumed 'WC_VERSION' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_recent-comments
    • woopos_credit_points_reward_points_zero_message
    • woopos_credit_points_reward_points_enable
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • woopos_credit_points_store_credit_enable
    • woopos_credit_points_store_credit_message
    • widget_recent-posts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_CRUD_Controller' not found in wp-content/plugins/woopos-store-credit-points/includes/class-wc-rest-woopos-credit-points-controller.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

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
Attributes that need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

woopos-store-credit-points/woopos_credit_points.php 92% from 13 tests

The principal PHP file in "WooPOS Store Credit & Points" v. 1.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woopos-store-credit-points.php" instead of "woopos_credit_points.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,119 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP81693311,105
JavaScript20014

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity26.25
▷ Minimum class complexity3.00
▷ Maximum class complexity71.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods77
▷ Static methods2329.87%
▷ Public methods7293.51%
▷ Protected methods56.49%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin