78% buythis-shortcode

Code Review | Buythis Shortcode

WordPress plugin Buythis Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: buythis-shortcode
  • Plugin version: 3.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Dec 26, 2021
  • Latest release: Oct 25, 2023
  • Number of updates: 35
  • Update frequency: every 19.1 days
  • Top authors: fulfillmentglobal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,170 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.15ms] Passed 4 tests

This is a short check of server-side resources used by Buythis Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0739.97 ▲3.67
Dashboard /wp-admin3.39 ▲0.0446.40 ▼7.95
Posts /wp-admin/edit.php3.50 ▲0.1442.61 ▼17.88
Add New Post /wp-admin/post-new.php5.97 ▲0.0779.60 ▼23.86
Media Library /wp-admin/upload.php3.31 ▲0.0836.57 ▲1.11
Buythis Shortcode /wp-admin/options-general.php?page=buythis_shortcode3.2530.33

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Buythis Shortcode: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.36 ▲0.141.73 ▲0.1743.58 ▲3.43
Dashboard /wp-admin2,196 ▲155.62 ▼0.0992.98 ▼8.2541.98 ▲1.08
Posts /wp-admin/edit.php2,101 ▲42.00 ▲0.0134.71 ▼4.6132.14 ▼5.45
Add New Post /wp-admin/post-new.php1,531 ▼423.11 ▼0.12759.66 ▲79.6860.63 ▲3.53
Media Library /wp-admin/upload.php1,404 ▲14.25 ▲0.0892.86 ▼4.3542.20 ▼3.13
Buythis Shortcode /wp-admin/options-general.php?page=buythis_shortcode7802.0022.8924.22

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

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=buythis_shortcode
    • > Notice in wp-content/plugins/buythis-shortcode/settings.php+40
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buythis-shortcode/settings.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/buythis-shortcode/buythis-shortcode.php:438

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

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (No screenshots at present.)
Please take inspiration from this readme.txt

buythis-shortcode/buythis-shortcode.php Passed 13 tests

The main PHP script in "Buythis Shortcode" version 3.1 is automatically included on every request by WordPress
82 characters long description:
This plugin provides a shortcode to interface between Wordpress and Buythis.co.za.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected392 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26632392

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions2090.91%
▷ Anonymous functions29.09%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin