73% free-gifts-widget-with-images

Code Review | Free Gifts Widget with Images

WordPress plugin Free Gifts Widget with Images scored73%from 54 tests.

About plugin

  • Plugin page: free-gifts-widget...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 6, 2014
  • Latest release: Jun 7, 2014
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: Yatko (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,255 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.91MB] [CPU: ▼50.98ms] Passed 4 tests

This is a short check of server-side resources used by Free Gifts Widget with Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.395.62 ▼38.04
Dashboard /wp-admin2.09 ▼1.215.75 ▼41.19
Posts /wp-admin/edit.php2.09 ▼1.265.66 ▼40.82
Add New Post /wp-admin/post-new.php2.09 ▼3.795.62 ▼83.86
Media Library /wp-admin/upload.php2.09 ▼1.134.93 ▼29.99

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_freegifts_widget
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Free Gifts Widget with Images
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲12613.61 ▼0.798.88 ▲6.9641.91 ▲0.38
Dashboard /wp-admin2,206 ▲185.85 ▲0.9596.94 ▼5.8637.07 ▼12.40
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0239.33 ▲4.0534.58 ▼3.22
Add New Post /wp-admin/post-new.php1,542 ▲2118.09 ▼5.08606.24 ▼61.6158.48 ▲4.36
Media Library /wp-admin/upload.php1,385 ▼04.20 ▼0.0194.37 ▼8.4541.72 ▼2.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_freegifts_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/free-gifts-widget-with-images/free_gifts.php:18

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt is a good inspiration

free-gifts-widget-with-images/free_gifts.php 85% from 13 tests

"Free Gifts Widget with Images" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 281 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("free-gifts-widget-with-images.php" instead of "free_gifts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected117 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1133996
JavaScript16016
CSS1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin