84% cresta-image-in-widget

Code Review | Cresta Image In Widget

WordPress plugin Cresta Image In Widget scored84%from 54 tests.

About plugin

  • Plugin page: cresta-image-in-w...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.8
  • WordPress version: 6.3.1
  • First release: Dec 27, 2016
  • Latest release: Jun 8, 2017
  • Number of updates: 16
  • Update frequency: every 10.1 days
  • Top authors: CrestaProject (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,626 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.41ms] Passed 4 tests

An overview of server-side resources used by Cresta Image In Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0639.21 ▼8.02
Dashboard /wp-admin3.37 ▲0.0749.63 ▼7.04
Posts /wp-admin/edit.php3.42 ▲0.0651.30 ▲1.09
Add New Post /wp-admin/post-new.php5.95 ▲0.0697.86 ▼8.51
Media Library /wp-admin/upload.php3.29 ▲0.0637.79 ▼2.07

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_cresta_image_in_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cresta Image In Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.73 ▲0.331.70 ▼0.2740.67 ▼3.13
Dashboard /wp-admin2,200 ▲125.83 ▲0.91105.62 ▼5.2841.49 ▲0.48
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0139.89 ▲2.9834.85 ▲0.62
Add New Post /wp-admin/post-new.php1,533 ▼023.11 ▲0.12662.57 ▼20.1355.31 ▲3.86
Media Library /wp-admin/upload.php1,382 ▼64.09 ▲0.0099.76 ▼16.5843.40 ▼6.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_cresta_image_in_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cresta-image-in-widget/cresta-image-in-widget.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Cresta Image In Widget Settings), #2 (Cresta Image In Widget Example in a post)
The official readme.txt might help

cresta-image-in-widget/cresta-image-in-widget.php Passed 13 tests

The entry point to "Cresta Image In Widget" version 1.0.3 is a PHP file that has certain tags in its header comment area
76 characters long description:
Simple plugin to show an image, photo or logo in a widget with text and link

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin234 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2011196
JavaScript10038

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods116.67%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.11MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/default-image.png1.34KB1.38KB0.00%
screenshot-1.png15.87KB15.94KB0.00%
screenshot-2.png91.37KB98.40KB0.00%