72% lava-directory-manager

Code Review | Lava Directory Manager

WordPress plugin Lava Directory Manager scored72%from 54 tests.

About plugin

  • Plugin page: lava-directory-ma...
  • Plugin version: 1.1.34
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Oct 7, 2015
  • Latest release: Feb 14, 2022
  • Number of updates: 140
  • Update frequency: every 16.7 days
  • Top authors: lavacode (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /61,709 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲1.13MB] [CPU: ▲10.67ms] Passed 4 tests

An overview of server-side resources used by Lava Directory Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.55 ▲1.0950.17 ▲8.48
Dashboard /wp-admin4.47 ▲1.1770.06 ▲17.17
Posts /wp-admin/edit.php4.57 ▲1.2165.22 ▲11.09
Add New Post /wp-admin/post-new.php7.03 ▲1.1499.93 ▲5.93
Media Library /wp-admin/upload.php4.35 ▲1.1256.76 ▲20.48
Categories /wp-admin/edit-tags.php?taxonomy=listing_category&post_type=lv_listing4.3754.39
All Listings /wp-admin/edit.php?post_type=lv_listing4.4353.34
Settings /wp-admin/edit.php?post_type=lv_listing&page=lava-lv_listing-settings4.6353.97
Locations /wp-admin/edit-tags.php?taxonomy=listing_location&post_type=lv_listing4.3755.43
Add New /wp-admin/post-new.php?post_type=lv_listing4.5870.62
Amenities /wp-admin/edit-tags.php?taxonomy=listing_amenities&post_type=lv_listing4.3750.91
Keyword /wp-admin/edit-tags.php?taxonomy=listing_keyword&post_type=lv_listing4.3753.37

Server storage [IO: ▲1.67MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 81 new files
Database: no new tables, 12 new options
New WordPress options
lava_directory_manager_settings
can_compress_scripts
widget_lava_directory_recents
db_upgraded
lvdr_req_field_once
widget_recent-comments
widget_recent-posts
widget_lava_directory_featured
theysaidso_admin_options
lava_dm_flushed
...

Browser metrics Passed 4 tests

A check of browser resources used by Lava Directory Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,085 ▲32416.45 ▲2.2712.91 ▲11.1343.95 ▲6.69
Dashboard /wp-admin2,396 ▲2187.17 ▲1.51126.30 ▲11.7041.89 ▼2.80
Posts /wp-admin/edit.php2,321 ▲2244.09 ▲2.0854.54 ▲14.2633.90 ▼2.72
Add New Post /wp-admin/post-new.php1,731 ▲20523.17 ▲0.02598.59 ▼101.4433.96 ▼24.25
Media Library /wp-admin/upload.php1,458 ▲585.18 ▲1.0293.24 ▼17.3844.43 ▼5.17
Categories /wp-admin/edit-tags.php?taxonomy=listing_category&post_type=lv_listing1,6314.3468.4732.38
All Listings /wp-admin/edit.php?post_type=lv_listing1,3634.0559.2131.16
Settings /wp-admin/edit.php?post_type=lv_listing&page=lava-lv_listing-settings2,7985.4272.6967.98
Locations /wp-admin/edit-tags.php?taxonomy=listing_location&post_type=lv_listing1,5504.1662.3829.51
Add New /wp-admin/post-new.php?post_type=lv_listing3,30210.51260.17153.56
Amenities /wp-admin/edit-tags.php?taxonomy=listing_amenities&post_type=lv_listing1,5994.2461.6330.90
Keyword /wp-admin/edit-tags.php?taxonomy=listing_keyword&post_type=lv_listing1,4734.0049.3930.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 12 options in the database
    • widget_lava_directory_recents
    • widget_theysaidso_widget
    • widget_lava_contact_single_page
    • lava_directory_manager_settings
    • widget_recent-posts
    • theysaidso_admin_options
    • lava_dm_flushed
    • db_upgraded
    • lvdr_req_field_once
    • widget_recent-comments
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lava-directory-manager/templates/template-listing-list.php
    • > /wp-content/plugins/lava-directory-manager/templates/template-map-htmls.php
  • 44× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lava-directory-manager/includes/widgets/html/widget-single-contact.php:18
    • > PHP Fatal error
      Uncaught Error: Call to a member function getTermOption() on null in wp-content/plugins/lava-directory-manager/includes/admin/part-edit-category-meta.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/lava-directory-manager/templates/content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lava-directory-manager/templates/form/lava-add-item-location.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lava-directory-manager/templates/form/lava-add-item-user.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lava-directory-manager/includes/admin/admin-welcome.php:2
    • > PHP Notice
      Undefined variable: addon in wp-content/plugins/lava-directory-manager/includes/admin/admin-loop-addons.php on line 3
    • > PHP Notice
      Trying to get property 'avatar' of non-object in wp-content/plugins/lava-directory-manager/includes/widgets/html/widget-single-contact.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lava-directory-manager/includes/functions-ajaxMap.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/lava-directory-manager/includes/admin/admin-mapmeta.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=listing_keyword&post_type=lv_listing
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?libraries=places%2Cgeometry&ver=0.0.1 244:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: There are too many tags (51 tag instead of maximum 10)
You can take inspiration from this readme.txt

lava-directory-manager/lava-directory-manager.php 92% from 13 tests

Analyzing the main PHP file in "Lava Directory Manager" version 1.1.34
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin15,554 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,1184995,611
JavaScript179649825,196
CSS416931,713
PO File15245791,102
LESS163471,015
SVG201917

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity35.86
▷ Minimum class complexity4.00
▷ Maximum class complexity110.00
Average method complexity3.01
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods243
▷ Static methods2610.70%
▷ Public methods243100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants00.00%
▷ Class constants22100.00%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/no-image.png4.52KB0.89KB▼ 80.29%
assets/images/lava_btn_slide_arrow.png1.67KB0.48KB▼ 71.02%