84% widget-favorites

Code Review | Widget Favorites

WordPress plugin Widget Favorites scored84%from 54 tests.

About plugin

  • Plugin page: widget-favorites
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 15, 2015
  • Latest release: Jan 30, 2015
  • Number of updates: 6
  • Update frequency: every 2.5 days
  • Top authors: westonruter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,573 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.52ms] Passed 4 tests

An overview of server-side resources used by Widget Favorites
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1436.37 ▼1.94
Dashboard /wp-admin3.43 ▲0.1344.67 ▼3.45
Posts /wp-admin/edit.php3.54 ▲0.1950.83 ▲1.41
Add New Post /wp-admin/post-new.php6.01 ▲0.1394.46 ▲4.60
Media Library /wp-admin/upload.php3.35 ▲0.1333.40 ▲1.88

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

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

Browser metrics Passed 4 tests

Widget Favorites: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.20 ▼1.174.63 ▲2.9241.35 ▼2.75
Dashboard /wp-admin2,206 ▲155.88 ▲1.00107.63 ▲3.7741.86 ▲0.70
Posts /wp-admin/edit.php2,089 ▼31.99 ▼0.0539.98 ▲0.5034.21 ▲0.63
Add New Post /wp-admin/post-new.php1,533 ▼023.05 ▼0.12593.22 ▼66.5748.89 ▼8.71
Media Library /wp-admin/upload.php1,385 ▲64.22 ▼0.1099.65 ▼0.5142.94 ▼1.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/widget-favorites/tests/test-class-plugin.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/widget-favorites/tests/test-class-filter-suspension.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WidgetFavorites\\Exception' not found in wp-content/plugins/widget-favorites/php/class-public-exception.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WidgetFavorites\\trailingslashit() in wp-content/plugins/widget-favorites/php/class-plugin.php:325

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: revisions, customizer, widgets

widget-favorites/widget-favorites.php 92% from 13 tests

The main PHP script in "Widget Favorites" version 0.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
There were no executable files found in this plugin1,198 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8144213672
JavaScript169139437
CSS13053
Markdown118036

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods3897.44%
▷ Protected methods12.56%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
PNG images were not found in this plugin