83% clicklease-buttons

Code Review | Clicklease Buttons

WordPress plugin Clicklease Buttons scored83%from 54 tests.

About plugin

  • Plugin page: clicklease-buttons
  • Plugin version: 2.0.4
  • PHP compatiblity:       7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Mar 22, 2022
  • Latest release: Jul 5, 2022
  • Number of updates: 27
  • Update frequency: every 4.0 days
  • Top authors: fjimenezq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /907 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼11.89ms] Passed 4 tests

Server-side resources used by Clicklease Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3548.96 ▲1.94
Dashboard /wp-admin3.70 ▲0.3650.87 ▼17.21
Posts /wp-admin/edit.php3.75 ▲0.4050.02 ▼0.97
Add New Post /wp-admin/post-new.php6.28 ▲0.4088.14 ▼31.32
Media Library /wp-admin/upload.php3.62 ▲0.4038.81 ▲3.73

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

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/clicklease-buttons/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Clicklease Buttons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲10813.33 ▼1.053.99 ▲2.1238.80 ▼1.37
Dashboard /wp-admin2,272 ▲694.89 ▼0.95104.64 ▲2.2741.40 ▼6.84
Posts /wp-admin/edit.php2,148 ▲482.02 ▼0.0133.92 ▼8.3534.56 ▼2.03
Add New Post /wp-admin/post-new.php1,558 ▲3223.15 ▲5.46680.00 ▲73.4061.30 ▼0.34
Media Library /wp-admin/upload.php1,446 ▲434.20 ▼0.0599.76 ▼7.1643.87 ▼2.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/api/CLSWP_LeaseHandlr.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/views/admin/CLSWP_MainSettignsPage.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/CLSWP_BtnsScripts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/services/buttons/builders/CLSWP_ButtonPhpBuilder.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/views/CLSWP_CategoryPage.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/form/validation/rules/CLSWP_ValidToken.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/CLSWP_Button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/form/validation/CLSWP_Validator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/views/CLSWP_CheckoutPage.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clicklease-buttons/includes/views/CLSWP_ProductPage.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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: Please add images for these screenshots: #1 (Clicklease icon: [wc_btns_plugin\src\assets\cl-icon.svg]), #2 (After installing our plugin, you will be able to see the Clicklease buttons icon on the right menu bar : [wc_btns_plugin\src\assets\screenShots\ScreenShot-1.png]), #3 (The admin panel asks for basic information like what pages to display the button and the personal token. The save button will be disabled until the token is entered successfully : [wc_btns_plugin\src\assets\screenShots\ScreenShot-2.png]), #4 (By clicking on the "Button Color" button you can choose the color and design for the button to display in the store: [wc_btns_plugin\src\assets\screenShots\ScreenShot-3.png]), #5 (By clicking the "Button Placement In Product Details Page" button you can choose the position to display the button on the product page: [wc_btns_plugin\src\assets\screenShots\ScreenShot-4.png]), #6 (By clicking the "Button Placement In Shopping Cart" button you can choose the position to display the button on the shopping cart page.: [wc_btns_plugin\src\assets\screenShots\ScreenShot-5.png])
Please take inspiration from this readme.txt

clicklease-buttons/ClickleaseButtons.php 85% from 13 tests

The principal PHP file in "Clicklease Buttons" v. 2.0.4 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("clicklease-buttons.php" instead of "ClickleaseButtons.php")
  • Requires PHP: Please use periods and digits for the required version (ex. "7.0" instead of "      7.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected6,140 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JSON5004,354
PHP282471811,768
SVG32016
JavaScript2042

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.12
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods167
▷ Static methods31.80%
▷ Public methods16196.41%
▷ Protected methods10.60%
▷ Private methods52.99%
Functions11
▷ Named functions327.27%
▷ Anonymous functions872.73%
Constants1
▷ Global constants00.00%
▷ Class constants1100.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
No PNG files were detected