74% points

Code Review | Points loyalty system

WordPress plugin Points loyalty system scored74%from 54 tests.

About plugin

  • Plugin page: points
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4.2
  • WordPress version: 6.3.1
  • First release: Nov 26, 2016
  • Latest release: Jun 20, 2020
  • Number of updates: 17
  • Update frequency: every 76.5 days
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,780 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼4.44ms] Passed 4 tests

An overview of server-side resources used by Points loyalty system
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1939.46 ▼5.02
Dashboard /wp-admin3.49 ▲0.1852.93 ▼0.24
Posts /wp-admin/edit.php3.60 ▲0.2449.29 ▼6.23
Add New Post /wp-admin/post-new.php6.09 ▲0.2090.13 ▼6.26
Media Library /wp-admin/upload.php3.41 ▲0.1839.22 ▲0.95
Points /wp-admin/admin.php?page=points3.3841.21
Options /wp-admin/admin.php?page=points-admin-options3.3837.37

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: 1 new table, 7 new options
New tables
wp_points_users
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_points_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Points loyalty system
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6413.16 ▼1.221.73 ▼0.1738.17 ▼7.88
Dashboard /wp-admin2,224 ▲445.80 ▲0.2089.95 ▼3.9774.59 ▲29.66
Posts /wp-admin/edit.php2,138 ▲382.16 ▲0.1738.06 ▲0.0532.26 ▼4.79
Add New Post /wp-admin/post-new.php1,565 ▲3918.32 ▼4.90714.62 ▲64.5765.48 ▲11.43
Media Library /wp-admin/upload.php1,432 ▲354.36 ▲0.15101.86 ▼22.0379.33 ▲30.60
Points /wp-admin/admin.php?page=points1,0751.9426.9131.82
Options /wp-admin/admin.php?page=points-admin-options9561.9327.8925.37

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_points_users
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_points_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
Please fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/points/lib/core/class-points-shortcodes.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/points/lib/core/class-points-widget-leaderboard.php:25
    • > 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/points/lib/core/class-points-table.php on line 5
    • > 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/points/lib/core/class-points-table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/points/lib/ext/class-points-wordpress.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/points/points.php:33
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/points/lib/core/class-points-table.php on line 5

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 97% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Options - you can adjust the plugin's settings here.), #2 (Points - Admin the Points from the dashboard.), #3 (Add manually - you can add Points manually.), #4 (Leader board widget.)
The official readme.txt is a good inspiration

points/points.php Passed 13 tests

The principal PHP file in "Points loyalty system" v. 1.1.4 is loaded by WordPress automatically on each request
22 characters long description:
Points loyalty system.

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
Good job! No executable or dangerous file extensions detected1,607 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9207313996
CSS37115498
PO File14445107
JavaScript2166

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity17.88
▷ Minimum class complexity2.00
▷ Maximum class complexity41.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods45
▷ Static methods3475.56%
▷ Public methods4395.56%
▷ Protected methods00.00%
▷ Private methods24.44%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
5 PNG files occupy 0.14MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png34.99KB9.53KB▼ 72.76%
screenshot-3.png28.86KB8.09KB▼ 71.95%
img/logo.png1.75KB1.48KB▼ 15.86%
screenshot-4.png19.71KB6.32KB▼ 67.95%
screenshot-2.png54.62KB14.36KB▼ 73.70%