10% alewb-image-widget

Code Review | Alewb Image Widget

WordPress plugin Alewb Image Widget scored10%from 54 tests.

About plugin

  • Plugin page: alewb-image-widget
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6.1
  • WordPress version: 6.3.1
  • First release: Dec 19, 2012
  • Latest release: Oct 18, 2013
  • Number of updates: 19
  • Update frequency: every 16.0 days
  • Top authors: Mischa1987 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /4,892 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/alewb-image-widget/alewb-image-widget.php+284
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.87ms] Passed 4 tests

An overview of server-side resources used by Alewb Image Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.45 ▼32.72
Dashboard /wp-admin2.05 ▼1.266.05 ▼42.29
Posts /wp-admin/edit.php2.05 ▼1.315.75 ▼44.38
Add New Post /wp-admin/post-new.php2.05 ▼3.845.18 ▼96.10
Media Library /wp-admin/upload.php2.05 ▼1.184.72 ▼30.20

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_alewbimage

Browser metrics Passed 4 tests

This is an overview of browser requirements for Alewb Image Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.25 ▼1.144.37 ▲2.7143.31 ▲1.64
Dashboard /wp-admin2,206 ▲184.85 ▼1.05111.98 ▼7.3641.73 ▼3.06
Posts /wp-admin/edit.php2,092 ▼02.02 ▼0.0441.81 ▼1.2436.12 ▼1.10
Add New Post /wp-admin/post-new.php1,544 ▲1122.93 ▼0.27627.73 ▼54.8959.10 ▼12.99
Media Library /wp-admin/upload.php1,388 ▲34.22 ▼0.0795.83 ▼15.6539.38 ▼8.17

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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/alewb-image-widget/alewb-image-widget.php+284
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_alewbimage
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/alewb-image-widget/alewb-image-widget.php:26
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/alewb-image-widget/alewb-image-widget.php on line 26

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: image, banner, widget

alewb-image-widget/alewb-image-widget.php Passed 13 tests

"Alewb Image Widget" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
43 characters long description:
This Widget add Image/banner to the Sidebar

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,843 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11,5441,5966,649
CSS190110
PHP11841684

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png7.60KB4.00KB▼ 47.35%
screenshot-3.png9.21KB6.55KB▼ 28.83%
screenshot-1.png119.30KB36.67KB▼ 69.26%