10% cubepoints

Code Review | CubePoints

WordPress plugin CubePoints scored10%from 54 tests.

About plugin

  • Plugin page: cubepoints
  • Plugin version: 3.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-3.4.2
  • WordPress version: 6.3.1
  • First release: Dec 27, 2008
  • Latest release: Nov 20, 2012
  • Number of updates: 94
  • Update frequency: every 15.2 days
  • Top authors: lauweijie7715 (77.66%)Petester (23.4%)

Code review

54 tests

User reviews

30 reviews

Install metrics

300+ active /94,128 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/cubepoints/cp_widgets.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; cp_pointsWidget has a deprecated constructor

Server metrics [RAM: ▼1.80MB] [CPU: ▼52.01ms] Passed 4 tests

Server-side resources used by CubePoints
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.278.28 ▼27.45
Dashboard /wp-admin2.21 ▼1.099.00 ▼46.33
Posts /wp-admin/edit.php2.21 ▼1.157.68 ▼44.96
Add New Post /wp-admin/post-new.php2.21 ▼3.688.56 ▼84.12
Media Library /wp-admin/upload.php2.21 ▼1.029.18 ▼32.64
Modules /wp-admin/admin.php?page=cp_admin_modules2.2110.56
Logs /wp-admin/admin.php?page=cp_admin_logs2.218.80
Configure /wp-admin/admin.php?page=cp_admin_config2.219.11
Add Points /wp-admin/admin.php?page=cp_admin_add_points2.217.64
Manage /wp-admin/admin.php?page=cp_admin_manage2.219.31

Server storage [IO: ▲0.60MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/cubepoints/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 66 new files
Database: 1 new table, 21 new options
New tables
wp_cp
New WordPress options
cp_del_comment_points
widget_theysaidso_widget
widget_cp_pointswidget
cp_auth_key
cp_suffix
cp_reg_points
cp_prefix
cp_db_version
db_upgraded
widget_cp_topuserswidget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for CubePoints
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9313.27 ▼1.131.85 ▲0.2443.40 ▼1.70
Dashboard /wp-admin2,260 ▲545.84 ▲0.95107.90 ▲4.2042.55 ▲0.48
Posts /wp-admin/edit.php2,142 ▲421.99 ▼0.0738.11 ▲1.5435.62 ▲1.87
Add New Post /wp-admin/post-new.php1,585 ▲5917.95 ▲0.23601.14 ▼4.1565.13 ▲15.22
Media Library /wp-admin/upload.php1,439 ▲394.19 ▼0.03104.21 ▲3.3748.19 ▲7.28
Modules /wp-admin/admin.php?page=cp_admin_modules1,2481.8636.7236.31
Logs /wp-admin/admin.php?page=cp_admin_logs8902.0130.7225.72
Configure /wp-admin/admin.php?page=cp_admin_config9642.0622.7730.39
Add Points /wp-admin/admin.php?page=cp_admin_add_points9301.7125.4626.95
Manage /wp-admin/admin.php?page=cp_admin_manage9511.9034.1933.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/cubepoints/cp_widgets.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; cp_pointsWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_cp
  • Zombie WordPress options were found after uninstall: 21 options
    • widget_cp_topuserswidget
    • db_upgraded
    • cp_post_points
    • widget_recent-posts
    • cp_db_version
    • cp_del_comment_points
    • cp_moduleVersions
    • cp_about_posts
    • widget_theysaidso_widget
    • cp_about_comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_admin_manage
    • > Deprecated in wp-content/plugins/cubepoints/cp_widgets.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; cp_pointsWidget has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_admin_manage
    • > Deprecated in wp-content/plugins/cubepoints/cp_widgets.php+93
    Methods with the same name as their class will not be constructors in a future version of PHP; cp_topUsersWidget has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_admin_manage
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in cp_pointsWidget is deprecated since version 4.3.0! Use __construct() instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_admin_manage
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in cp_topUsersWidget is deprecated since version 4.3.0! Use __construct() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cp_admin_add_points
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Almost there! Just fix the following items
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_module_register() in wp-content/plugins/cubepoints/modules/paid_content.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cubepoints/cp_admin_modules.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_module_register() in wp-content/plugins/cubepoints/modules/reset.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_module_register() in wp-content/plugins/cubepoints/modules/ranks.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_module_register() in wp-content/plugins/cubepoints/modules/points_multiplier.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cubepoints/cp_upgrade.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_module_register() in wp-content/plugins/cubepoints/modules/limit_logs.php:5
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/cubepoints/cubepoints.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cubepoints/cp_widgets.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_module_register() in wp-content/plugins/cubepoints/modules/custom_points.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Plugin Name: You should set the name of your plugin on the first line ( === cubepoints === )
  • Screenshots: Please add images for these screenshots: #1 (Manage the points of your users), #2 (View recent point transactions), #3 (Extend CubePoints with modules), #4 (Advanced widget configurations)
You can take inspiration from this readme.txt

cubepoints/cubepoints.php 92% from 13 tests

This is the main PHP file of "CubePoints" version 3.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 353 characters long)

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
Everything looks great! No dangerous files found in this plugin4,161 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP315092382,944
JavaScript690148886
CSS5504331

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.00
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions148
▷ Named functions148100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/donate.png0.75KB0.67KB▼ 9.69%
screenshot-2.png22.13KB11.35KB▼ 48.72%
screenshot-4.png14.13KB7.94KB▼ 43.80%
screenshot-1.png28.39KB14.22KB▼ 49.92%
screenshot-3.png34.25KB19.07KB▼ 44.33%