67% geodirectory

Code Review | GeoDirectory - WordPress Business Directory Plugin, or Classified Directory

WordPress plugin GeoDirectory - WordPress Business Directory Plugin, or Classified Directory scored67%from 54 tests.

About plugin

  • Plugin page: geodirectory
  • Plugin version: 2.3.32
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2014
  • Latest release: Nov 30, 2023
  • Number of updates: 307
  • Update frequency: every 11.6 days
  • Top authors: stiofansisland (52.12%)paoltaia (48.21%)

Code review

54 tests

User reviews

590 reviews

Install metrics

10,000+ active /1,275,204 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.44MB] [CPU: ▲16.57ms] 50% from 4 tests

A check of server-side resources used by GeoDirectory - WordPress Business Directory Plugin, or Classified Directory
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,579.58ms on /wp-admin/admin.php?page=gd-status)
  • RAM: The total memory usage must be kept under 10MB (currently 10.35MB on /wp-admin/post-new.php?post_type=gd_place)
PageMemory (MB)CPU Time (ms)
Home /5.76 ▲2.3063.44 ▲23.63
Dashboard /wp-admin4.45 ▲1.1554.94 ▲6.33
Posts /wp-admin/edit.php4.54 ▲1.1858.33 ▲13.97
Add New Post /wp-admin/post-new.php19.39 ▲13.50172.15 ▲78.26
Media Library /wp-admin/upload.php4.38 ▲1.1553.05 ▲22.36
Extensions /wp-admin/admin.php?page=gd-addons9.991,624.57
Settings /wp-admin/edit.php?post_type=gd_place&page=gd_place-settings5.3972.41
Place Tags /wp-admin/edit-tags.php?taxonomy=gd_place_tags&post_type=gd_place4.4559.87
Place Categories /wp-admin/edit-tags.php?taxonomy=gd_placecategory&post_type=gd_place4.6655.11
Status /wp-admin/admin.php?page=gd-status9.431,579.58
Places /wp-admin/edit.php?post_type=gd_place4.8351.95
Settings /wp-admin/admin.php?page=gd-settings9.16101.47
Add New /wp-admin/post-new.php?post_type=gd_place10.35134.56
Dashboard /wp-admin/admin.php?page=geodirectory9.1797.30
AyeCode UI /wp-admin/options-general.php?page=ayecode-ui-settings9.1787.11

Server storage [IO: ▲21.70MB] [DB: ▲0.24MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • Illegal file modification found: 1 file (1.04KB) outside of "wp-content/plugins/geodirectory/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/geodir-fast-ajax.php
Filesystem: 1,167 new files
Database: 9 new tables, 51 new options
New tables
wp_geodir_api_keys
wp_geodir_custom_sort_fields
wp_geodir_post_reports
wp_geodir_gd_place_detail
wp_countries
wp_geodir_post_review
wp_geodir_custom_fields
wp_geodir_tabs_layout
wp_geodir_attachments
New WordPress options
widget_gd_single_taxonomies
widget_gd_simple_archive
widget_gd_listings
can_compress_scripts
widget_gd_dynamic_content
widget_gd_single_reviews
widget_gd_search
geodirectory_version
widget_gd_post_distance
widget_gd_post_meta
...

Browser metrics Passed 4 tests

GeoDirectory - WordPress Business Directory Plugin, or Classified Directory: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,112 ▲36115.11 ▲0.8745.79 ▲44.1045.35 ▲1.93
Dashboard /wp-admin2,330 ▲1595.67 ▲0.0990.46 ▼11.7041.94 ▼3.54
Posts /wp-admin/edit.php2,197 ▲971.99 ▲0.0439.37 ▼0.0338.23 ▲2.57
Add New Post /wp-admin/post-new.php6,468 ▲4,93127.26 ▲2.14867.16 ▲240.3440.24 ▼24.75
Media Library /wp-admin/upload.php1,536 ▲1424.31 ▲0.06102.28 ▲7.6342.39 ▲1.28
Extensions /wp-admin/admin.php?page=gd-addons2,4353.2881.8262.36
Settings /wp-admin/edit.php?post_type=gd_place&page=gd_place-settings2,6914.0584.8558.20
Place Tags /wp-admin/edit-tags.php?taxonomy=gd_place_tags&post_type=gd_place1,5303.2245.5933.73
Place Categories /wp-admin/edit-tags.php?taxonomy=gd_placecategory&post_type=gd_place7,8878.63522.08156.29
Status /wp-admin/admin.php?page=gd-status3,5064.0985.3843.63
Places /wp-admin/edit.php?post_type=gd_place1,4413.4854.8529.53
Settings /wp-admin/admin.php?page=gd-settings2,4855.62145.7287.65
Add New /wp-admin/post-new.php?post_type=gd_place4,67210.87283.42120.79
Dashboard /wp-admin/admin.php?page=geodirectory1,7735.98182.1282.33
AyeCode UI /wp-admin/options-general.php?page=ayecode-ui-settings1,1532.3031.7335.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 9 tables
    • wp_geodir_post_review
    • wp_geodir_post_reports
    • wp_geodir_tabs_layout
    • wp_geodir_custom_sort_fields
    • wp_geodir_gd_place_detail
    • wp_countries
    • wp_geodir_api_keys
    • wp_geodir_attachments
    • wp_geodir_custom_fields
  • This plugin did not uninstall successfully, leaving 51 options in the database
    • widget_gd_post_content
    • widget_gd_post_images
    • widget_gd_search
    • widget_gd_post_meta
    • widget_gd_dynamic_content
    • gd_placecategory_installed
    • widget_gd_loop
    • widget_gd_report_post
    • widget_gd_loop_paging
    • widget_gd_category_description
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 24× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/geodirectory/templates/emails/plain/geodir-email-user_pending_post.php
    • > /wp-content/plugins/geodirectory/templates/emails/plain/geodir-email-owner_comment_approved.php
    • > /wp-content/plugins/geodirectory/templates/emails/geodir-email-footer.php
    • > /wp-content/plugins/geodirectory/templates/emails/geodir-email-owner_comment_approved.php
    • > /wp-content/plugins/geodirectory/templates/emails/plain/geodir-email-admin_post_edit.php
    • > /wp-content/plugins/geodirectory/templates/emails/plain/geodir-email-admin_report_post.php
    • > /wp-content/plugins/geodirectory/templates/emails/geodir-email-admin_post_edit.php
    • > /wp-content/plugins/geodirectory/templates/emails/geodir-email-admin_report_post.php
    • > /wp-content/plugins/geodirectory/templates/emails/geodir-email-user_pending_post.php
    • > /wp-content/plugins/geodirectory/templates/emails/geodir-email-header.php
  • 190× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/geodirectory/templates/content-archive-listing.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Super_Duper' not found in wp-content/plugins/geodirectory/includes/widgets/class-geodir-widget-author-actions.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Super_Duper' not found in wp-content/plugins/geodirectory/includes/widgets/class-geodir-widget-post-badge.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/geodirectory/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php:7

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
The official readme.txt might help

geodirectory/geodirectory.php Passed 13 tests

The principal PHP file in "GeoDirectory - WordPress Business Directory Plugin, or Classified Directory" v. 2.3.32 is loaded by WordPress automatically on each request
55 characters long description:
GeoDirectory - Business Directory Plugin for WordPress.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin245,497 lines of code in 949 files:
LanguageFilesBlank linesComment linesLines of code
PHP44323,54737,245120,423
JavaScript9512,8229,69768,554
Sass3636,6546,77640,399
PO File14,4287,57110,272
SVG50145,078
JSON100460
CSS3013173206
XML114240
HTML9489639
Markdown111026

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 352)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity50.02
▷ Minimum class complexity1.00
▷ Maximum class complexity902.00
Average method complexity6.57
▷ Minimum method complexity1.00
▷ Maximum method complexity352.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes286
▷ Abstract classes72.45%
▷ Concrete classes27997.55%
▷ Final classes10.36%
Methods2,523
▷ Static methods1,18747.05%
▷ Public methods2,22388.11%
▷ Protected methods1576.22%
▷ Private methods1435.67%
Functions827
▷ Named functions79896.49%
▷ Anonymous functions293.51%
Constants255
▷ Global constants23893.33%
▷ Class constants176.67%
▷ Public constants17100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
88 PNG files occupy 1.07MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/arrow-img.png0.42KB0.42KB0.23%
assets/images/arrows_down.png1.76KB0.58KB▼ 67.28%
assets/images/downarrow-img.png0.22KB0.26KB0.00%
assets/images/t-image2.png11.71KB12.01KB0.00%
assets/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%