84% favorites

Code Review | Favorites

WordPress plugin Favorites scored84%from 54 tests.

About plugin

  • Plugin page: favorites
  • Plugin version: 2.3.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2015
  • Latest release: May 30, 2023
  • Number of updates: 111
  • Update frequency: every 27.1 days
  • Top authors: kylephillips (100%)

Code review

54 tests

User reviews

124 reviews

Install metrics

10,000+ active /217,458 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▲0.74ms] Passed 4 tests

Analyzing server-side resources used by Favorites
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.4943.02 ▲0.50
Dashboard /wp-admin3.71 ▲0.4045.56 ▼3.75
Posts /wp-admin/edit.php3.76 ▲0.4052.03 ▲3.74
Add New Post /wp-admin/post-new.php6.36 ▲0.47100.27 ▲12.75
Media Library /wp-admin/upload.php3.57 ▲0.3438.68 ▲2.47
Favorites /wp-admin/options-general.php?page=simple-favorites3.5733.18

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 112 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
simplefavorites_display
widget_recent-posts
theysaidso_admin_options
simplefavorites_dependencies
db_upgraded
simplefavorites_cache_enabled
widget_recent-comments
simplefavorites_users

Browser metrics Passed 4 tests

An overview of browser requirements for Favorites
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲17113.70 ▼0.739.70 ▲7.7842.85 ▼4.21
Dashboard /wp-admin2,209 ▲246.00 ▲0.16104.76 ▼0.0436.65 ▼8.34
Posts /wp-admin/edit.php2,095 ▲62.02 ▼0.0139.43 ▲2.5934.48 ▲1.22
Add New Post /wp-admin/post-new.php6,446 ▲4,91320.14 ▼3.35844.81 ▲168.2255.86 ▼4.29
Media Library /wp-admin/upload.php1,394 ▲64.23 ▲0.0593.63 ▼10.9641.29 ▼5.48
Favorites /wp-admin/options-general.php?page=simple-favorites9432.1848.5235.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 10 options
    • simplefavorites_users
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • simplefavorites_cache_enabled
    • db_upgraded
    • simplefavorites_display
    • can_compress_scripts
    • simplefavorites_dependencies

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 41× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/Installer.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/favorites/vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/favorites/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/favorites/app/Views/settings/settings-general.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Favorites\\Entities\\FavoriteList\\FavoriteListTypeBase' not found in wp-content/plugins/favorites/app/Entities/FavoriteList/FavoriteListTypeCustom.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

favorites/favorites.php Passed 13 tests

"Favorites" version 2.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
55 characters long description:
Simple and flexible favorite buttons for any post type.

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 plugin6,225 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP876501,5474,106
JavaScript3104210843
PO File2299327664
CSS3488293
JSON300139
Markdown1320130
XML12023
SVG10019
YAML1308

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity7.86
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces0
Traits0
Classes74
▷ Abstract classes56.76%
▷ Concrete classes6993.24%
▷ Final classes00.00%
Methods280
▷ Static methods134.64%
▷ Public methods19168.21%
▷ Protected methods227.86%
▷ Private methods6723.93%
Functions24
▷ Named functions2291.67%
▷ Anonymous functions28.33%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin