67% web-directory-free

Code Review | Web Directory Free

WordPress plugin Web Directory Free scored 67% from 54 tests.

About plugin

  • Plugin page: web-directory-free
  • Plugin version: 1.6.8
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 23, 2018
  • Latest release: Jun 4, 2023
  • Number of updates: 117
  • Update frequency: every 15.7 days
  • Top authors: Mihail Chepovskiy (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

700+ active / 34,926 total downloads

Benchmarks

Plugin footprint 64% 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: ▲8.44MB] [CPU: ▲53.81ms] 50% from 4 tests

A check of server-side resources used by Web Directory Free
Please have a look at the following items
  • RAM: You should keep total memory usage under 10MB (currently 11.71MB on /wp-admin/admin.php?page=w2dc_levels)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 8.44MB on /wp-admin/admin.php?page=w2dc_levels)
PageMemory (MB)CPU Time (ms)
Home /11.70 ▲8.2489.79 ▲48.04
Dashboard /wp-admin11.78 ▲8.48110.89 ▲57.86
Posts /wp-admin/edit.php11.91 ▲8.55123.02 ▲71.05
Add New Post /wp-admin/post-new.php14.54 ▲8.65149.03 ▲43.78
Media Library /wp-admin/upload.php11.74 ▲8.50101.83 ▲65.55
Listings upgrade /wp-admin/admin.php?page=w2dc_manage_upgrades11.7191.98
Change level of listing /wp-admin/options.php?page=w2dc_upgrade11.7293.13
Locations levels /wp-admin/admin.php?page=w2dc_locations_levels11.7185.98
Directory listings /wp-admin/edit.php?post_type=w2dc_listing11.7996.74
Renew listing /wp-admin/options.php?page=w2dc_renew11.7292.98
Directory settings /wp-admin/themes.php?page=w2dc_settings13.06124.08
Create new listing /wp-admin/post-new.php?post_type=w2dc_listing11.6793.52
Directory Reset /wp-admin/admin.php?page=w2dc_reset11.70103.89
CSV Import/Export /wp-admin/admin.php?page=w2dc_csv_import11.7392.90
Listings levels /wp-admin/admin.php?page=w2dc_levels11.7191.75

Server storage [IO: ▲13.13MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 1,425 new files
Database: 8 new tables, 233 new options
New tables
wp_w2dc_directories
wp_w2dc_content_fields
wp_w2dc_levels_relationships
wp_w2dc_content_fields_groups
wp_wcsearch_cache
wp_w2dc_levels
wp_w2dc_locations_relationships
wp_w2dc_locations_levels
New WordPress options
w2dc_address_autocomplete_code
w2dc_prevent_users_see_other_media
w2dc_share_buttons_style
w2dc_locations_search_nesting_level
w2dc_admin_notifications_email
widget_w2dc_locations_widget
w2dc_links_color
w2dc_addresses_order
w2dc_listing_contact_form
w2dc_zip_or_postal_text
...

Browser metrics Passed 4 tests

Checking browser requirements for Web Directory Free
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲19713.42 ▼0.961.67 ▼0.2536.16 ▼7.68
Dashboard /wp-admin2,317 ▲1295.13 ▲0.23116.52 ▲5.6789.40 ▲44.40
Posts /wp-admin/edit.php2,227 ▲1352.34 ▲0.3537.45 ▼1.1536.21 ▲2.24
Add New Post /wp-admin/post-new.php1,785 ▲25020.70 ▼2.62820.30 ▲149.5138.66 ▼18.84
Media Library /wp-admin/upload.php1,505 ▲1144.43 ▲0.17103.90 ▼2.0681.63 ▲35.90
Listings upgrade /wp-admin/admin.php?page=w2dc_manage_upgrades1,0264.1967.6334.18
Change level of listing /wp-admin/options.php?page=w2dc_upgrade7781.537.2617.94
Locations levels /wp-admin/admin.php?page=w2dc_locations_levels1,1154.0664.9432.09
Directory listings /wp-admin/edit.php?post_type=w2dc_listing1,4064.2963.9451.89
Renew listing /wp-admin/options.php?page=w2dc_renew7781.146.5217.59
Directory settings /wp-admin/themes.php?page=w2dc_settings13,3656.85236.97175.29
Create new listing /wp-admin/post-new.php?post_type=w2dc_listing4,36810.97253.40173.99
Directory Reset /wp-admin/admin.php?page=w2dc_reset9341.9331.1030.87
CSV Import/Export /wp-admin/admin.php?page=w2dc_csv_import1,2804.1354.7138.46
Listings levels /wp-admin/admin.php?page=w2dc_levels1,1144.2860.4247.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 tables in the database
    • wp_wcsearch_cache
    • wp_w2dc_directories
    • wp_w2dc_content_fields_groups
    • wp_w2dc_levels_relationships
    • wp_w2dc_levels
    • wp_w2dc_content_fields
    • wp_w2dc_locations_levels
    • wp_w2dc_locations_relationships
  • Zombie WordPress options detected upon uninstall: 233 options
    • w2dc_single_logo_width
    • w2dc_map_infowindow_offset
    • db_upgraded
    • w2dc_address_geocode
    • w2dc_primary_color
    • w2dc_cropped_content_as_excerpt
    • w2dc_listing_thumb_width
    • w2dc_listings_bottom_margin
    • w2dc_subcategories_items
    • widget_w2dc_content_fields_group_shortcode_widget
    • ...

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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
Please take a closer look at the following
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/web-directory-free/templates/content_fields/fields_group_input.tpl.php
    • > /wp-content/plugins/web-directory-free/templates/frontend/page_header.tpl.php
    • > /wp-content/plugins/web-directory-free/templates/admin_footer.tpl.php
    • > /wp-content/plugins/web-directory-free/addons/w2dc_ratings/templates/comments.tpl.php
    • > /wp-content/plugins/web-directory-free/search/plugin/templates/admin_footer.tpl.php
    • > /wp-content/plugins/web-directory-free/templates/our_plugins.tpl.php
    • > /wp-content/plugins/web-directory-free/templates/frontend/listings_carousel.tpl.php
    • > /wp-content/plugins/web-directory-free/templates/frontend/listings_block.tpl.php
  • 882× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: map_args in wp-content/plugins/web-directory-free/templates/maps/map.tpl.php on line 4
    • > PHP Warning
      Use of undefined constant VP_W2DC_PUBLIC_URL - assumed 'VP_W2DC_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/web-directory-free/vafpress-framework/config/dependencies.php on line 188
    • > PHP Fatal error
      Uncaught Error: Call to a member function title() on null in wp-content/plugins/web-directory-free/templates/frontend/single_parts/header.tpl.php:1
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/web-directory-free/classes/levels/levels_manager.php on line 188
    • > PHP Warning
      Use of undefined constant VP_W2DC_NAMESPACE - assumed 'VP_W2DC_NAMESPACE' (this will throw an Error in a future version of PHP) in wp-content/plugins/web-directory-free/vafpress-framework/autoload.php on line 13
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/web-directory-free/classes/content_fields/content_fields_manager.php on line 305
    • > PHP Warning
      include_once(W2DC_PATHclasses/content_fields/fields/content_field_email.php): failed to open stream: No such file or directory in wp-content/plugins/web-directory-free/classes/content_fields/content_fields.php on line 15
    • > PHP Warning
      include_once(W2DC_PATHclasses/content_fields/fields/content_field_radio.php): failed to open stream: No such file or directory in wp-content/plugins/web-directory-free/classes/content_fields/content_fields.php on line 13
    • > PHP Notice
      Trying to get property 'default_url' of non-object in wp-content/plugins/web-directory-free/templates/upload_image.tpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'w2dc_elementor_widget' not found in wp-content/plugins/web-directory-free/classes/widgets/elementor/widgets/listing_report.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: store locator, google maps, listings, mapbox openstreetmap, classifieds...

web-directory-free/w2dc_free.php 85% from 13 tests

This is the main PHP file of "Web Directory Free" version 1.6.8, 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:
  • Main file name: Name the main plugin file the same as the plugin slug ("web-directory-free.php" instead of "w2dc_free.php")
  • Description: The description should be shorter than 140 characters (currently 186 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected128,826 lines of code in 752 files:
LanguageFilesBlank linesComment linesLines of code
PHP4859,4136,59154,113
CSS422,2891,15740,550
JavaScript1373,7174,29320,805
Sass7426307,797
PO File21,7972,5894,074
SVG3001,208
HTML360123
Markdown231089
XML34066
JSON1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 112)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity26.40
▷ Minimum class complexity1.00
▷ Maximum class complexity368.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity112.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes217
▷ Abstract classes73.23%
▷ Concrete classes21096.77%
▷ Final classes00.00%
Methods1,804
▷ Static methods904.99%
▷ Public methods1,71194.84%
▷ Protected methods774.27%
▷ Private methods160.89%
Functions475
▷ Named functions46297.26%
▷ Anonymous functions132.74%
Constants83
▷ Global constants8096.39%
▷ Class constants33.61%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
539 PNG files occupy 1.88MB with 0.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/map_icons/icons/_new/Train.png3.53KB2.08KB▼ 41.19%
resources/images/map_icons/icons/_new/Airport.png3.61KB2.09KB▼ 42.08%
resources/css/jquery-ui/themes/blitzer/images/ui-bg_highlight-soft_15_cc0000_1x100.png0.31KB0.18KB▼ 43.48%
resources/css/jquery-ui/themes/excite-bike/images/ui-bg_diagonals-small_25_c5ddfc_40x40.png0.33KB0.10KB▼ 70.47%
resources/images/map_icons/icons/_new/Fruits.png3.79KB2.32KB▼ 38.68%