10% wp-my-favourites

Code Review | WP My Favourites

WordPress plugin WP My Favourites scored10%from 54 tests.

About plugin

  • Plugin page: wp-my-favourites
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 6, 2017
  • Latest release: Sep 25, 2017
  • Number of updates: 35
  • Update frequency: every 0.6 days
  • Top authors: Myself.Neelkanth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /755 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Error in wp-content/plugins/wp-my-favourites/includes/class-wp-myfavourites-settings.php+45
    Uncaught ArgumentCountError: Too few arguments to function Wp_MyFavourites_Settings::__construct(), 0 passed in wp-content/plugins/wp-my-favourites/includes/class-wp-myfavourites-activator.php on line 73 and exactly 2 expected in wp-content/plugins/wp-my-favourites/includes/class-wp-myfavourites-settings.php:45
    Stack trace:
    #0 wp-content/plugins/wp-my-favourites/includes/class-wp-myfavourites-activator.php(73): Wp_MyFavourites_Settings->__construct()
    #1 wp-content/plugins/wp-my-favourites/wp-myfavourites.php(39): Wp_MyFavourites_Activator::activate()
    #2 wp-includes/class-wp-hook.php(310): activate_wp_myfavourites()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.04ms] Passed 4 tests

An overview of server-side resources used by WP My Favourites
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.10 ▼1.96
Dashboard /wp-admin3.31 ▲0.0045.34 ▼3.06
Posts /wp-admin/edit.php3.36 ▲0.0054.26 ▲11.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.51 ▼7.36
Media Library /wp-admin/upload.php3.23 ▲0.0033.64 ▲0.24

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP My Favourites
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.25 ▼1.511.84 ▼0.6543.31 ▼2.60
Dashboard /wp-admin2,206 ▲184.85 ▼0.04101.38 ▼6.4939.31 ▲1.39
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0134.40 ▼3.5834.18 ▼3.40
Add New Post /wp-admin/post-new.php1,537 ▲923.13 ▲4.83665.86 ▲53.1053.22 ▼0.39
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.03100.75 ▼1.7144.69 ▼2.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-my-favourites/admin/partials/wp-myfavourites-admin-display.php
    • > /wp-content/plugins/wp-my-favourites/public/partials/wp-myfavourites-media-display.php
    • > /wp-content/plugins/wp-my-favourites/public/partials/wp-myfavourites-posts-display.php
    • > /wp-content/plugins/wp-my-favourites/admin/partials/settings/wp-myfavourites-favourite-media-settings.php
    • > /wp-content/plugins/wp-my-favourites/public/partials/wp-myfavourites-comments-display.php
    • > /wp-content/plugins/wp-my-favourites/public/partials/wp-myfavourites-public-display.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_MYFAVOURITES_MEDIA_SELECT_LIMIT - assumed 'WP_MYFAVOURITES_MEDIA_SELECT_LIMIT' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-my-favourites/admin/partials/settings/wp-myfavourites-favourite-media-settings.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-my-favourites/admin/partials/settings/wp-myfavourites-plugin-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Wp_MyFavourites_Settings' not found in wp-content/plugins/wp-my-favourites/admin/partials/settings/wp-myfavourites-favourite-posts-settings.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Wp_MyFavourites_Settings' not found in wp-content/plugins/wp-my-favourites/admin/partials/settings/wp-myfavourites-favourite-comments-settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: theme development, media, posts, comments, favourites

wp-my-favourites/wp-myfavourites.php 85% from 13 tests

The main file in "WP My Favourites" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-my-favourites.php" instead of "wp-myfavourites.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,605 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP212447841,567
JavaScript833102912
CSS71227126

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity16.89
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods56
▷ Static methods712.50%
▷ Public methods5089.29%
▷ Protected methods00.00%
▷ Private methods610.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants40
▷ Global constants00.00%
▷ Class constants40100.00%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/jqueryui/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
admin/css/jqueryui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/jqueryui/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
admin/css/jqueryui/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
admin/css/jqueryui/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%