84% shortcode-to-flag

Code Review | Shortcode to flag

WordPress plugin Shortcode to flag scored84%from 54 tests.

About plugin

  • Plugin page: shortcode-to-flag
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 9, 2015
  • Latest release: Jan 9, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: DJetelina (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active /1,561 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.43MB] [CPU: ▼1.22ms] Passed 4 tests

Analyzing server-side resources used by Shortcode to flag
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4638.89 ▼3.04
Dashboard /wp-admin3.74 ▲0.4348.29 ▼3.15
Posts /wp-admin/edit.php3.78 ▲0.4252.89 ▲5.88
Add New Post /wp-admin/post-new.php6.31 ▲0.4296.99 ▲0.71
Media Library /wp-admin/upload.php3.66 ▲0.4336.50 ▲0.61

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

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

Browser metrics Passed 4 tests

Shortcode to flag: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.26 ▼1.111.75 ▲0.0939.55 ▲1.38
Dashboard /wp-admin2,206 ▲184.84 ▼0.0497.14 ▼8.0941.51 ▼3.69
Posts /wp-admin/edit.php2,086 ▼61.99 ▼0.0140.79 ▼1.9135.54 ▼5.01
Add New Post /wp-admin/post-new.php1,533 ▲1923.12 ▲5.42633.64 ▼44.0257.17 ▼2.58
Media Library /wp-admin/upload.php1,382 ▼64.26 ▲0.0195.08 ▼15.2842.92 ▼6.61

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortcode-to-flag/shortcode-to-flag.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: shortcodes, flags, flag, shortcode, country

shortcode-to-flag/shortcode-to-flag.php Passed 13 tests

The principal PHP file in "Shortcode to flag" v. 1.0 is loaded by WordPress automatically on each request
51 characters long description:
Basic plugin that turns a shortcode to a flag image

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin38 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1661231
CSS1007

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
242 PNG files occupy 0.55MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/img/IR.png2.61KB2.14KB▼ 17.96%
flags/img/BR.png3.67KB2.25KB▼ 38.63%
flags/img/NZ.png3.09KB2.14KB▼ 30.81%
flags/img/FK.png3.98KB2.29KB▼ 42.55%
flags/img/RU.png1.30KB1.79KB0.00%