94% country-info-visual-editor-wysiwyg-button

Code Review | Country Info Visual Editor (WYSIWYG) Button

WordPress plugin Country Info Visual Editor (WYSIWYG) Button scored 94% from 54 tests.

About plugin

  • Plugin page: country-info-visu...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jun 6, 2017
  • Latest release: Dec 9, 2017
  • Number of updates: 6
  • Update frequency: every 31.0 days
  • Top authors: behzod (100%)Otto42 (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 647 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼138.50ms] Passed 4 tests

Server-side resources used by Country Info Visual Editor (WYSIWYG) Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1732.99 ▲13.58
Dashboard /wp-admin3.12 ▲0.0742.50 ▲0.45
Posts /wp-admin/edit.php3.17 ▲0.0644.06 ▼0.93
Add New Post /wp-admin/post-new.php5.48 ▲0.0589.55 ▼558.74
Media Library /wp-admin/upload.php3.06 ▲0.0632.81 ▲5.23

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Country Info Visual Editor (WYSIWYG) Button: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10816.26 ▲0.779.03 ▼3.1344.37 ▼4.26
Dashboard /wp-admin2,970 ▲366.03 ▼0.01148.96 ▲5.88113.67 ▼0.34
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0063.57 ▼0.5489.31 ▼3.74
Add New Post /wp-admin/post-new.php1,672 ▼1118.88 ▲0.12366.42 ▼15.27109.11 ▲4.43
Media Library /wp-admin/upload.php1,813 ▼125.03 ▼0.00146.79 ▼10.30118.57 ▼3.95

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Country_Info_Visual_Editor_Button\\add_action() in wp-content/plugins/country-info-visual-editor-wysiwyg-button/country-info-visual-editor-button.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: The official readme.txt might help

country-info-visual-editor-wysiwyg-button/country-info-visual-editor-button.php 92% from 13 tests

The main file in "Country Info Visual Editor (WYSIWYG) Button" v. 1.0.1 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:
  • Main file name: Name the main plugin file the same as the plugin slug ("country-info-visual-editor-wysiwyg-button.php" instead of "country-info-visual-editor-button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected359 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32377326
JavaScript11233

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/globe.png1.57KB1.20KB▼ 23.49%