78% alkubot

Code Review | Alkubot - Gamify discounts, sell more and give less at the right time

WordPress plugin Alkubot - Gamify discounts, sell more and give less at the right time scored78%from 54 tests.

About plugin

  • Plugin page: alkubot
  • Plugin version: 3.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Oct 21, 2019
  • Latest release: Apr 6, 2021
  • Number of updates: 46
  • Update frequency: every 11.7 days
  • Top authors: alkubot (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼12.06ms] Passed 4 tests

Server-side resources used by Alkubot - Gamify discounts, sell more and give less at the right time
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.19 ▼9.66
Dashboard /wp-admin3.38 ▲0.0353.84 ▼15.28
Posts /wp-admin/edit.php3.49 ▲0.1349.93 ▼2.62
Add New Post /wp-admin/post-new.php5.96 ▲0.0785.50 ▼20.67
Media Library /wp-admin/upload.php3.30 ▲0.0739.69 ▲4.61

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Alkubot - Gamify discounts, sell more and give less at the right time: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.59 ▼0.651.56 ▼0.1638.13 ▼4.77
Dashboard /wp-admin2,224 ▲214.86 ▼0.01101.67 ▼13.9139.09 ▲0.46
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0138.16 ▼2.5234.65 ▼2.37
Add New Post /wp-admin/post-new.php1,525 ▼2522.68 ▼0.46669.76 ▼5.9954.52 ▼5.32
Media Library /wp-admin/upload.php1,400 ▲34.23 ▼0.09111.16 ▼4.3948.40 ▼2.51

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

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

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/alkubot/admin/views/layouts/loader.php
    • > /wp-content/plugins/alkubot/alkubot.php
    • > /wp-content/plugins/alkubot/admin/views/layouts/popup.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/alkubot/admin/views/layouts/notification.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/alkubot/admin/views/layouts/notification.php:10
    • > PHP Warning
      include_once(ALKUBOT_ADMIN_VIEWS_PATH/popups/error.php): failed to open stream: No such file or directory in wp-content/plugins/alkubot/admin/views/layouts/popup.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/alkubot/admin/views/popups/success.php:7
    • > PHP Warning
      include_once(): Failed opening 'ALKUBOT_ADMIN_VIEWS_PATH/popups/success.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/alkubot/admin/views/layouts/popup.php on line 2
    • > PHP Warning
      Use of undefined constant ALKUBOT_IMAGES_PATH - assumed 'ALKUBOT_IMAGES_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/alkubot/admin/views/layouts/loader.php on line 3
    • > PHP Warning
      Use of undefined constant ALKUBOT_IMAGES_PATH - assumed 'ALKUBOT_IMAGES_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/alkubot/admin/views/popups/error.php on line 3
    • > PHP Warning
      Use of undefined constant ALKUBOT_ADMIN_VIEWS_PATH - assumed 'ALKUBOT_ADMIN_VIEWS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/alkubot/admin/views/layouts/popup.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/alkubot/config.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/alkubot/admin/views/popups/error.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can take inspiration from this readme.txt

alkubot/alkubot.php 92% from 13 tests

"Alkubot - Gamify discounts, sell more and give less at the right time" version 3.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
No dangerous file extensions were detected1,749 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP222322511,126
CSS3163234
Sass8250211
PO File233294
JavaScript220284

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.29
Average class complexity8.07
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods70
▷ Static methods5984.29%
▷ Public methods4361.43%
▷ Protected methods00.00%
▷ Private methods2738.57%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants25
▷ Global constants25100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu-icon.png2.91KB1.44KB▼ 50.47%
images/yes-alt.png0.61KB0.54KB▼ 12.42%
images/logo.png0.72KB0.83KB0.00%
images/popup-close.png0.49KB0.48KB▼ 3.18%
images/popup-profile.png1.32KB1.13KB▼ 14.25%