83% british-foreign-office-travel-advice

Code Review | British Foreign Office Travel Advice

WordPress plugin British Foreign Office Travel Advice scored 83% from 54 tests.

About plugin

  • Plugin page: british-foreign-o...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.0
  • WordPress version: 6.3.1
  • First release: Oct 22, 2014
  • Latest release: Oct 24, 2014
  • Number of updates: 14
  • Update frequency: every 0.2 days
  • Top authors: mattaitch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 893 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by British Foreign Office Travel Advice
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.99 ▼1.96
Dashboard /wp-admin3.31 ▲0.0144.89 ▼5.30
Posts /wp-admin/edit.php3.36 ▲0.0047.23 ▼6.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.25 ▼5.18
Media Library /wp-admin/upload.php3.23 ▲0.0035.96 ▲2.19

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for British Foreign Office Travel Advice
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲15313.54 ▼0.789.49 ▲7.3042.45 ▼2.99
Dashboard /wp-admin2,200 ▲94.85 ▼1.05122.63 ▲18.7146.79 ▲6.19
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0340.59 ▼0.2537.27 ▲2.02
Add New Post /wp-admin/post-new.php1,533 ▼223.36 ▲0.02638.36 ▼6.3451.48 ▼1.20
Media Library /wp-admin/upload.php1,391 ▼04.21 ▼0.09103.40 ▲1.9945.01 ▲1.00

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/british-foreign-office-travel-advice/index.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Create a custom meta tag in any post and add the country as the value), #2 (Once you've added the shortcode for pushing the information to a page on load up, this is what you'll see)
The official readme.txt might help

british-foreign-office-travel-advice/index.php 85% from 13 tests

The main PHP script in "British Foreign Office Travel Advice" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 182 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("british-foreign-office-travel-advice.php" instead of "index.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
Everything looks great! No dangerous files found in this plugin420 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript34053202
PHP16947164
CSS18254

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.11
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.17MB with 0.14MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
2.png73.90KB21.83KB▼ 70.47%
img/plus.png27.81KB0.16KB▼ 99.43%
img/minus.png50.27KB0.16KB▼ 99.68%
1.png22.80KB7.69KB▼ 66.26%