84% yatri-tools

Code Review | Yatri Tools

WordPress plugin Yatri Tools scored 84% from 54 tests.

About plugin

  • Plugin page: yatri-tools
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.2
  • WordPress version: 5.9.2
  • First release: Feb 4, 2020
  • Latest release: Mar 18, 2022
  • Number of updates: 29
  • Update frequency: every 26.7 days
  • Top authors: mantrabrain (100%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active / 9,368 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼292.11ms] Passed 4 tests

Analyzing server-side resources used by Yatri Tools
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1251.65 ▲3.58
Dashboard /wp-admin3.47 ▲0.0633.87 ▲1.28
Posts /wp-admin/edit.php3.70 ▲0.0538.15 ▲0.83
Add New Post /wp-admin/post-new.php6.94 ▼0.0398.42 ▼1,162.24
Media Library /wp-admin/upload.php3.35 ▲0.0424.02 ▼8.31

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 232 new files
Database: no new tables, 3 new options
New WordPress options
yatri_tools_upload_dir_created
yatri_tools_plugin_do_activation_redirect
yatri_tools_version

Browser metrics Passed 4 tests

An overview of browser requirements for Yatri Tools
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,810 ▲5616.21 ▲0.656.43 ▼0.403.02 ▲0.47
Dashboard /wp-admin2,903 ▲456.09 ▼0.10115.09 ▼18.86154.20 ▼1.20
Posts /wp-admin/edit.php2,703 ▲153.24 ▲0.0062.90 ▼3.11138.92 ▲2.59
Add New Post /wp-admin/post-new.php1,671 ▼8115.65 ▼5.49426.35 ▼25.07154.82 ▼1.27
Media Library /wp-admin/upload.php1,713 ▲185.51 ▼0.03134.66 ▼8.14184.77 ▼8.44

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
  • Zombie WordPress options detected upon uninstall: 3 options
    • yatri_tools_plugin_do_activation_redirect
    • yatri_tools_version
    • yatri_tools_upload_dir_created

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yatri-tools/includes/cache/class-yatri-tools-customizer-cache.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yatri-tools/includes/customizer/class-yatri-tools-customizer.php:17
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/yatri-tools/includes/customizer/prebuilt-header/prebuilt-header.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/yatri-tools/includes/admin/templates/feedback-form-failed.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yatri-tools/includes/hooks/class-yatri-tools-template-hooks.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/yatri-tools/includes/yatri-tools-demo-data.php:3
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/yatri-tools/includes/cache/sections/customizer-cache.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Yatri_Tools_Elementor\\add_action() in wp-content/plugins/yatri-tools/includes/elementor/hooks/class-yatri-tools-elementor-hooks.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yatri-tools/includes/admin/class-yatri-tools-admin.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yatri-tools/includes/class-yatri-tools-ajax.php:8

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: demo import, tools, elementor template library

yatri-tools/yatri-tools.php 92% from 13 tests

This is the main PHP file of "Yatri Tools" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 142 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin41,683 lines of code in 182 files:
LanguageFilesBlank linesComment linesLines of code
PHP1388,46316,84235,950
JavaScript171,3164263,685
CSS25325171,821
Markdown1680214
SVG11013

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity66.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes70
▷ Abstract classes22.86%
▷ Concrete classes6897.14%
▷ Final classes34.41%
Methods1,304
▷ Static methods18914.49%
▷ Public methods94072.09%
▷ Protected methods332.53%
▷ Private methods33125.38%
Functions101
▷ Named functions9998.02%
▷ Anonymous functions21.98%
Constants137
▷ Global constants11281.75%
▷ Class constants2518.25%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/elementor/assets/images/yatri-full-logo.png9.19KB4.96KB▼ 46.09%
includes/elementor/assets/images/yatri-logo.png9.28KB4.15KB▼ 55.26%
includes/panel/assets/img/logo.png8.73KB3.75KB▼ 57.08%