10% ivisa-travel

Code Review | iVisa Travel

WordPress plugin iVisa Travel scored10%from 54 tests.

About plugin

  • Plugin page: ivisa-travel
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.1
  • WordPress version: 6.3.1
  • First release: Sep 2, 2017
  • Latest release: Apr 5, 2019
  • Number of updates: 4
  • Update frequency: every 149.5 days
  • Top authors: sergiomerino (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,033 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/ivisa-travel/public/ivisa-widget.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; iVisaPluginWidget has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼55.56ms] Passed 4 tests

Analyzing server-side resources used by iVisa Travel
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.324.42 ▼37.46
Dashboard /wp-admin2.16 ▼1.145.94 ▼47.92
Posts /wp-admin/edit.php2.16 ▼1.195.70 ▼46.31
Add New Post /wp-admin/post-new.php2.16 ▼3.725.78 ▼90.55
Media Library /wp-admin/upload.php2.16 ▼1.076.75 ▼28.03
iVisa Travel /wp-admin/options-general.php?page=ivisa2.166.48

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_ivisawidget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for iVisa Travel
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14513.58 ▼0.724.59 ▲2.6441.31 ▼7.34
Dashboard /wp-admin2,217 ▲265.90 ▲1.00103.61 ▼12.4839.68 ▼4.23
Posts /wp-admin/edit.php2,094 ▲22.01 ▼0.0135.95 ▼1.7033.48 ▲1.04
Add New Post /wp-admin/post-new.php1,526 ▼1623.43 ▲5.32702.30 ▲56.9553.36 ▼2.13
Media Library /wp-admin/upload.php1,396 ▲84.31 ▲0.06110.50 ▲5.5246.95 ▲0.34
iVisa Travel /wp-admin/options-general.php?page=ivisa8732.0522.8630.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/ivisa-travel/public/ivisa-widget.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; iVisaPluginWidget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_ivisawidget
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ivisa
    • > Deprecated in wp-content/plugins/ivisa-travel/public/ivisa-widget.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; iVisaPluginWidget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=ivisa
    • > Notice in wp-content/plugins/ivisa-travel/admin/partials/ivisa-admin-display.php+60
    Trying to access array offset on value of type bool

SRP 0% 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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ivisa-travel/public/partials/ivisa-public-display.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ivisa-travel/public/partials/widget_html.php:11
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/ivisa-travel/public/partials/widget_html.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ivisa-travel/admin/partials/ivisa-admin-display.php:20
    • > PHP Notice
      Undefined variable: ivisa_countries in wp-content/plugins/ivisa-travel/public/partials/widget_html.php on line 4
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/ivisa-travel/public/partials/widget_info.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ivisa-travel/public/ivisa-widget.php:8

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 83% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Here's what the widget looks like in a post or in your sidebar), #2 (This pop-up window shows results once the user selects their destination)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

ivisa-travel/ivisa.php 77% from 13 tests

"iVisa Travel" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 558 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ivisa-travel.php" instead of "ivisa.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin469 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15203586407
JavaScript2135432
CSS2131230

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.12
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods38
▷ Static methods615.79%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.10MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png32.72KB7.94KB▼ 75.74%
screenshot-2.png74.77KB21.79KB▼ 70.85%