10% power-widgets-lite

Code Review | Power Widgets Lite

WordPress plugin Power Widgets Lite scored10%from 54 tests.

About plugin

  • Plugin page: power-widgets-lite
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.9.2
  • WordPress version: 6.3.1
  • First release: Mar 4, 2014
  • Latest release: Oct 28, 2014
  • Number of updates: 13
  • Update frequency: every 18.6 days
  • Top authors: sgPlanwize (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /3,947 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/power-widgets-lite/php/classes/DbFunctionsLite.php+513
    Non-static method DbFunctionsLite::deleteDefwas() should not be called statically

Server metrics [RAM: ▼1.56MB] [CPU: ▼45.81ms] Passed 4 tests

This is a short check of server-side resources used by Power Widgets Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.43 ▼1.049.83 ▼37.47
Dashboard /wp-admin2.44 ▼0.8613.54 ▼30.84
Posts /wp-admin/edit.php2.44 ▼0.9114.47 ▼30.34
Add New Post /wp-admin/post-new.php2.44 ▼3.4413.18 ▼84.60
Media Library /wp-admin/upload.php2.44 ▼0.7914.51 ▼23.13
Posts /wp-admin/admin.php?page=CScontrolposts-slug-name2.4413.70
Getting Started /wp-admin/admin.php?page=site_builder-slug-name2.4413.56
Page Templates /wp-admin/admin.php?page=CScontrolpagetemplates-slug-name2.4412.83
Manage Widget Areas /wp-admin/admin.php?page=CS-slug-name2.4413.53
Pages /wp-admin/admin.php?page=CScontrol-slug-name2.4411.95
Categories /wp-admin/admin.php?page=CScontrolcategories-slug-name2.4414.03
Tags /wp-admin/admin.php?page=CScontroltags-slug-name2.4413.30

Server storage [IO: ▲1.50MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 352 new files
Database: 6 new tables, 8 new options
New tables
wp_overriding_prot_wa
wp_replacement_wa
wp_prototypes_wa
wp_default_wa
wp_old_default_wa
wp_custom_wa
New WordPress options
widget_recent-posts
widget_recent-comments
pw_old_theme
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
pw_blog_version

Browser metrics Passed 4 tests

A check of browser resources used by Power Widgets Lite
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲19413.65 ▼0.645.80 ▲3.9842.55 ▲3.63
Dashboard /wp-admin2,245 ▲575.79 ▼0.14103.71 ▼4.3539.73 ▼4.97
Posts /wp-admin/edit.php2,142 ▲562.03 ▲0.0233.95 ▼3.1035.01 ▲1.99
Add New Post /wp-admin/post-new.php6,539 ▲5,02523.48 ▲5.92925.01 ▲202.83100.79 ▲37.34
Media Library /wp-admin/upload.php1,444 ▲564.22 ▼0.03102.19 ▼12.3042.65 ▼5.61
Posts /wp-admin/admin.php?page=CScontrolposts-slug-name1,3033.7079.9642.95
Getting Started /wp-admin/admin.php?page=site_builder-slug-name1,0762.1023.4063.80
Page Templates /wp-admin/admin.php?page=CScontrolpagetemplates-slug-name1,3063.5883.9251.03
Manage Widget Areas /wp-admin/admin.php?page=CS-slug-name8411.8826.1425.52
Pages /wp-admin/admin.php?page=CScontrol-slug-name1,3242.8786.8942.34
Categories /wp-admin/admin.php?page=CScontrolcategories-slug-name1,2873.6478.5242.05
Tags /wp-admin/admin.php?page=CScontroltags-slug-name1,2872.8781.7741.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/power-widgets-lite/php/classes/DbFunctionsLite.php+513
    Non-static method DbFunctionsLite::deleteDefwas() should not be called statically
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CScontroltags-slug-name
    • > POST request to /wp-admin/admin-ajax.php?action=get_repwas_table¤t_theme=Twenty%20Twenty-One&rep_type=tag&edited_post=
    • > Deprecated in wp-content/plugins/power-widgets-lite/php/classes/DbFunctionsLite.php+513
    Non-static method DbFunctionsLite::deleteDefwas() should not be called statically
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CScontroltags-slug-name
    • > POST request to /wp-admin/admin-ajax.php?action=get_repwas_table¤t_theme=Twenty%20Twenty-One&rep_type=tag&edited_post=
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. Unsupported value type (object). Please see Debugging in WordPress for more information. (This message was added in version 4.8.2.)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CScontroltags-slug-name
    • > POST request to /wp-admin/admin-ajax.php?action=get_repwas_table¤t_theme=Twenty%20Twenty-One&rep_type=tag&edited_post=
    • > Error in wp-content/plugins/power-widgets-lite/php/classes/repwas/RepwasAjaxHandler.php+45
    Uncaught Error: Call to undefined function mysql_real_escape_string() in wp-content/plugins/power-widgets-lite/php/classes/repwas/RepwasAjaxHandler.php:45
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): RepwasAjaxHandler->handleGetRepwasTable()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin-ajax.php(188): do_action()
    #4 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CS-slug-name
    • > Warning in wp-content/plugins/power-widgets-lite/php/classes/was/gui/WasGuiManager.php+86
    Use of undefined constant PWL - assumed 'PWL' (this will throw an Error in a future version of PHP)

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
Please fix the following items
  • 50× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PwListOfUnique' not found in wp-content/plugins/power-widgets-lite/php/classes/was/WidgetAreaList.php:11
    • > PHP Warning
      Use of undefined constant pw_repwas - assumed 'pw_repwas' (this will throw an Error in a future version of PHP) in wp-content/plugins/power-widgets-lite/php/classes/repwas/RepwasManager.php on line 7
    • > PHP Warning
      require_once(pw_classes/repwas/gui/LogicRepwasTableHeader.php): failed to open stream: No such file or directory in wp-content/plugins/power-widgets-lite/php/classes/repwas/gui/LogicRepwasTable.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'RepwasGuiManager' not found in wp-content/plugins/power-widgets-lite/php/classes/repwas/edit_mode/gui/RepwasEditModeGuiManager.php:10
    • > PHP Warning
      Use of undefined constant pw_classes - assumed 'pw_classes' (this will throw an Error in a future version of PHP) in wp-content/plugins/power-widgets-lite/php/classes/repwas/gui/LogicRepwasTable.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'BasicReplaceable' not found in wp-content/plugins/power-widgets-lite/php/classes/repwas/replaceables/page_templates/PwPageTemplate.php:9
    • > PHP Warning
      require(pw_classes/PwList.php): failed to open stream: No such file or directory in wp-content/plugins/power-widgets-lite/php/classes/repwas/gui/CustwasDropdown.php on line 3
    • > PHP Warning
      require_once(pw_repwas/gui/LogicRepwasTable.php): failed to open stream: No such file or directory in wp-content/plugins/power-widgets-lite/php/classes/repwas/RepwasAjaxHandler.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'pw_repwas/gui/LogicRepwasTable.php' (include_path='.:/usr/share/php') in wp-content/plugins/power-widgets-lite/php/classes/repwas/RepwasAjaxHandler.php on line 9
    • > PHP Warning
      Use of undefined constant pw_edit_mode - assumed 'pw_edit_mode' (this will throw an Error in a future version of PHP) in wp-content/plugins/power-widgets-lite/php/classes/repwas/edit_mode/RepwasEditMode.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=CScontrolposts-slug-name
    • > Network (severe)
    wp-admin/admin-ajax.php?action=get_repwas_table&current_theme=Twenty%20Twenty-One&rep_type=post&edited_post= - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=CScontrolpagetemplates-slug-name
    • > Network (severe)
    wp-admin/admin-ajax.php?action=get_repwas_table&current_theme=Twenty%20Twenty-One&rep_type=page_template&edited_post= - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=CScontrol-slug-name
    • > Network (severe)
    wp-admin/admin-ajax.php?action=get_repwas_table&current_theme=Twenty%20Twenty-One&rep_type=page&edited_post= - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=CScontrolcategories-slug-name
    • > Network (severe)
    wp-admin/admin-ajax.php?action=get_repwas_table&current_theme=Twenty%20Twenty-One&rep_type=category&edited_post= - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=CScontroltags-slug-name
    • > Network (severe)
    wp-admin/admin-ajax.php?action=get_repwas_table&current_theme=Twenty%20Twenty-One&rep_type=tag&edited_post= - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
  • Screenshots: These screenshots do not have images: #1 (Create a new custom sidebar.), #2 (Your new widget area is now available in Appearance/Widgets.), #3 (Assign a custom sidebar to a page.), #4 (Working from within a given page.)
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can look at the official readme.txt

power-widgets-lite/PowerWidgetsLite.php 85% from 13 tests

Analyzing the main PHP file in "Power Widgets Lite" version 1.1.6
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 188 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("power-widgets-lite.php" instead of "PowerWidgetsLite.php")

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
Success! There were no dangerous files found in this plugin40,741 lines of code in 213 files:
LanguageFilesBlank linesComment linesLines of code
CSS131353023,093
JavaScript28513913,992
PHP521,0762,0013,428
PO File2168558228

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity4.40
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes46
▷ Abstract classes12.17%
▷ Concrete classes4597.83%
▷ Final classes00.00%
Methods359
▷ Static methods6016.71%
▷ Public methods33793.87%
▷ Protected methods00.00%
▷ Private methods226.13%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants2592.59%
▷ Class constants27.41%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
117 compressed PNG files occupy 0.20MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/jquery-easyui-1.3.4/themes/metro/images/messager_icons.png5.97KB3.40KB▼ 43.03%
js/jquery-easyui-1.3.4/themes/black/images/layout_arrows.png0.17KB0.17KB▼ 2.79%
images/cross.png0.64KB0.72KB0.00%
js/jquery-easyui-1.3.4/themes/bootstrap/images/layout_arrows.png0.31KB0.25KB▼ 21.32%
js/jquery-easyui-1.3.4/themes/black/images/calendar_arrows.png0.17KB0.18KB0.00%