10% wpi-designer-button-shortcode

Code Review | WPi Designer Button

WordPress plugin WPi Designer Button scored 10% from 54 tests.

About plugin

  • Plugin page: wpi-designer-butt...
  • Plugin version: 3.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.2-5.6.0
  • WordPress version: 5.9.2
  • First release: Mar 15, 2015
  • Latest release: Dec 23, 2021
  • Number of updates: 181
  • Update frequency: every 14.0 days
  • Top authors: wooprali (99.45%)Otto42 (1.1%)

Code review

54 tests

User reviews

23 reviews

Install metrics

4,000+ active / 70,352 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+307
    Non-static method WPi_DesignerButtonActivation::myplugin_activate() should not be called statically

Server metrics [RAM: ▲0.61MB] [CPU: ▼299.06ms] Passed 4 tests

This is a short check of server-side resources used by WPi Designer Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.42 ▲0.9064.46 ▲14.92
Dashboard /wp-admin4.26 ▲0.8548.53 ▲12.95
Posts /wp-admin/edit.php4.54 ▲0.9042.02 ▲3.78
Add New Post /wp-admin/post-new.php6.78 ▼0.1976.00 ▼1,215.83
Media Library /wp-admin/upload.php4.20 ▲0.9028.17 ▲2.87
Share Buttons /wp-admin/edit.php?post_type=wpi_des_but_sb4.2534.24
Call To Action /wp-admin/edit.php?post_type=wpi_des_but_sli4.2529.93
Global Settings /wp-admin/admin.php?page=global_settings4.1632.42
Styles /wp-admin/edit.php?post_type=wpi_des_but_sty4.2531.43
Twin Buttons /wp-admin/edit.php?post_type=wpi_des_but_tb4.2530.15
Buttons /wp-admin/edit.php?post_type=wpi_des_but4.2541.58

Server storage [IO: ▲6.17MB] [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: 272 new files
Database: no new tables, 2 new options
New WordPress options
designer_button
widget_wpi_designer_button_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPi Designer Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /10,479 ▲6,73718.73 ▲2.917.65 ▲1.422.44 ▲0.20
Dashboard /wp-admin9,515 ▲6,6547.63 ▲1.17169.08 ▲30.43166.18 ▲0.76
Posts /wp-admin/edit.php2,768 ▲743.43 ▼0.0168.47 ▲4.62187.85 ▲41.88
Add New Post /wp-admin/post-new.php1,684 ▲2320.24 ▲3.95413.36 ▼22.26215.70 ▲49.69
Media Library /wp-admin/upload.php1,781 ▲835.75 ▲0.04128.80 ▼8.91201.21 ▲13.09
Share Buttons /wp-admin/edit.php?post_type=wpi_des_but_sb8,0044.86118.55141.86
Call To Action /wp-admin/edit.php?post_type=wpi_des_but_sli8,0274.97109.36141.61
Global Settings /wp-admin/admin.php?page=global_settings8,0274.17113.00177.44
Styles /wp-admin/edit.php?post_type=wpi_des_but_sty8,0284.84111.95174.49
Twin Buttons /wp-admin/edit.php?post_type=wpi_des_but_tb8,0044.70110.04133.54
Buttons /wp-admin/edit.php?post_type=wpi_des_but8,0404.85106.16145.89

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
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_wpi_designer_button_widget
    • designer_button

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=global_settings
    • > Warning in wp-content/plugins/wpi-designer-button-shortcode/wpi-designer-button-shortcode.php+156
    Use of undefined constant VERSION - assumed 'VERSION' (this will throw an Error in a future version of PHP)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpi-designer-button-shortcode/inc/backup/wpi-designer-button-shortcode.php
    • > /wp-content/plugins/wpi-designer-button-shortcode/wpi-designer-button-shortcode.php
    • > /wp-content/plugins/wpi-designer-button-shortcode/admin.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/pages.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/shareButtons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/slides.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/smartButtons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/styles.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/buttons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/twinButtons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpi-designer-button-shortcode/inc/caption.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpi-designer-button-shortcode/inc/buttonWidget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (26 tag instead of maximum 10)
The official readme.txt is a good inspiration

wpi-designer-button-shortcode/wpi-designer-button-shortcode.php 85% from 13 tests

"WPi Designer Button" version 3.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/locale/")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin22,623 lines of code in 191 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript13307868,187
CSS91932047,607
PHP16281653,198
SVG14901502,516
JSON100634
HTML1851342
Markdown1670118
YAML1132321

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity20.95
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods172
▷ Static methods5330.81%
▷ Public methods172100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
43 PNG files occupy 2.28MB with 0.76MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/star_rays.png223.16KB131.70KB▼ 40.98%
images/thumbnails/a5.png31.53KB26.55KB▼ 15.80%
images/thumbnails/a14.png53.99KB46.72KB▼ 13.48%
images/blur1.png200.96KB140.11KB▼ 30.28%
images/bottom_lighting.png50.83KB17.45KB▼ 65.67%