78% uk-food-hygiene-rating

Code Review | UK Food Hygiene Rating

WordPress plugin UK Food Hygiene Rating scored78%from 54 tests.

About plugin

  • Plugin page: uk-food-hygiene-r...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7
  • WordPress version: 6.3.1
  • First release: Dec 17, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: runawaycoin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /668 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.82ms] Passed 4 tests

Server-side resources used by UK Food Hygiene Rating
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.78 ▼3.99
Dashboard /wp-admin3.35 ▲0.0550.74 ▼1.70
Posts /wp-admin/edit.php3.40 ▲0.0448.24 ▼5.75
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.96 ▼15.84
Media Library /wp-admin/upload.php3.28 ▲0.0440.51 ▲1.37
UK Food Hygiene Rating /wp-admin/options-general.php?page=uk-food-hygiene-rating3.2233.01

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for UK Food Hygiene Rating
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.27 ▼0.261.85 ▼0.3843.23 ▼3.65
Dashboard /wp-admin2,193 ▲135.54 ▼0.1784.52 ▼16.8739.93 ▼6.00
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0134.60 ▼3.1633.61 ▼0.00
Add New Post /wp-admin/post-new.php1,529 ▲322.76 ▼0.15600.12 ▼90.2750.84 ▼2.76
Media Library /wp-admin/upload.php1,404 ▲74.12 ▼0.07104.71 ▼4.7245.58 ▲0.63
UK Food Hygiene Rating /wp-admin/options-general.php?page=uk-food-hygiene-rating9352.0422.9230.50

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=uk-food-hygiene-rating
    • > Notice in wp-content/plugins/uk-food-hygiene-rating/options.php+65
    Trying to access array offset on value of type bool

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 items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/uk-food-hygiene-rating/uk-food-hygiene-rating.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/uk-food-hygiene-rating/uk-food-hygiene-rating.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/uk-food-hygiene-rating/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Contributors: Plugin contributors not specified
You can look at the official readme.txt

uk-food-hygiene-rating/uk-food-hygiene-rating.php Passed 13 tests

"UK Food Hygiene Rating" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
63 characters long description:
Show UK Food Agency hygiene rating on your wordpress blog posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected229 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34411229

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin