83% wp-insurance

Code Review | WP Insurance - WordPress Insurance Service Plugin

WordPress plugin WP Insurance - WordPress Insurance Service Plugin scored83%from 54 tests.

About plugin

  • Plugin page: wp-insurance
  • Plugin version: 2.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 5, 2018
  • Latest release: Aug 7, 2023
  • Number of updates: 40
  • Update frequency: every 44.2 days
  • Top authors: devitemsllc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /6,100 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.53MB] [CPU: ▲1.56ms] 75% from 4 tests

This is a short check of server-side resources used by WP Insurance - WordPress Insurance Service Plugin
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,324.64ms on /wp-admin/admin.php?page=wpinsurance-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5043.50 ▲3.91
Dashboard /wp-admin3.89 ▲0.5955.45 ▲5.39
Posts /wp-admin/edit.php3.95 ▲0.5954.82 ▲2.94
Add New Post /wp-admin/post-new.php6.41 ▲0.5398.50 ▼5.99
Media Library /wp-admin/upload.php3.73 ▲0.5043.89 ▲9.08
Options /wp-admin/admin.php?page=wpinsurance_options3.7344.64
Gallery /wp-admin/edit.php?post_type=wpinsurance_gallery3.8749.09
Agent /wp-admin/edit.php?post_type=wpinsurance_agent3.8643.97
Recommendations /wp-admin/admin.php?page=wpinsurance-recommendations8.101,324.64
Services /wp-admin/edit.php?post_type=wpinsurance3.8752.04

Server storage [IO: ▲1.94MB] [DB: ▲0.67MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 59 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
settings
widget_theysaidso_widget
db_upgraded
widget_recent-posts
pro_themes
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Insurance - WordPress Insurance Service Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,181 ▲42015.75 ▲1.3812.58 ▲10.8545.56 ▲3.33
Dashboard /wp-admin2,418 ▲2416.36 ▲0.70126.30 ▲15.2345.39 ▼1.38
Posts /wp-admin/edit.php2,357 ▲2543.74 ▲1.7051.28 ▲8.1040.93 ▲2.81
Add New Post /wp-admin/post-new.php1,455 ▼8020.77 ▲2.31571.27 ▼56.9837.94 ▼23.10
Media Library /wp-admin/upload.php1,497 ▲944.50 ▲0.2787.01 ▼15.8645.14 ▼2.73
Options /wp-admin/admin.php?page=wpinsurance_options1,2433.4395.2834.37
Gallery /wp-admin/edit.php?post_type=wpinsurance_gallery1,3413.6151.2436.56
Agent /wp-admin/edit.php?post_type=wpinsurance_agent1,3353.7049.1932.91
Recommendations /wp-admin/admin.php?page=wpinsurance-recommendations3,1543.4652.57109.40
Services /wp-admin/edit.php?post_type=wpinsurance1,3443.6051.0131.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.67MB] 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
  • This plugin does not fully uninstall, leaving 8 options in the database
    • settings
    • db_upgraded
    • theysaidso_admin_options
    • pro_themes
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-insurance/includes/single-wpinsurance_agent.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-insurance/admin/wpinsurance_shortcode.php:85
    • > PHP Warning
      Use of undefined constant WPINSURANCE_ADDONS_PL_PATH - assumed 'WPINSURANCE_ADDONS_PL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-insurance/admin/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-insurance/admin/wpinsurance_custom-post-type.php:239
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-insurance/includes/archive-wpinsurance.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'WPINSURANCE_ADDONS_PL_PATHadmin/admin-init.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-insurance/admin/init.php on line 2
    • > PHP Warning
      require_once(WPINSURANCE_ADDONS_PL_PATHadmin/admin-init.php): failed to open stream: No such file or directory in wp-content/plugins/wp-insurance/admin/init.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WPInsurance_Settings_API' not found in wp-content/plugins/wp-insurance/admin/plugin-options.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-insurance/includes/single-wpinsurance.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-insurance/admin/admin-init.php:17

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #10, #11, #2, #3, #4, #5, #6, #7, #8, #9 in wp-insurance/assets to your readme.txt
You can look at the official readme.txt

wp-insurance/wpinsurance.php 85% from 13 tests

"WP Insurance - WordPress Insurance Service Plugin" version 2.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-insurance.php" instead of "wpinsurance.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
No dangerous file extensions were detected11,752 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP218274186,706
SVG1002,671
CSS6158542,209
JavaScript73961166

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity27.40
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods85
▷ Static methods11.18%
▷ Public methods7385.88%
▷ Protected methods1214.12%
▷ Private methods00.00%
Functions29
▷ Named functions2896.55%
▷ Anonymous functions13.45%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/extensions/ht-script-pro.png6.03KB2.71KB▼ 55.09%
admin/images/extensions/just-tables-pro.png1.02KB1.05KB0.00%
admin/images/extensions/ht-slider-addons-pro.png6.41KB4.35KB▼ 32.23%
(invalid) admin/images/extensions/wp-plugin-manager-pro.png13.31KB0.00KB▼ 100.00%
admin/images/extensions/multicurrencypro.png19.01KB9.36KB▼ 50.77%