67% advanced-classifieds-and-directory-pro

Code Review | Advanced Classifieds & Directory Pro

WordPress plugin Advanced Classifieds & Directory Pro scored67%from 54 tests.

About plugin

  • Plugin page: advanced-classifi...
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: May 11, 2016
  • Latest release: Jul 5, 2023
  • Number of updates: 97
  • Update frequency: every 27.0 days
  • Top authors: pluginsware (100%)

Code review

54 tests

User reviews

90 reviews

Install metrics

3,000+ active /155,512 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.40MB] [CPU: ▲10.27ms] 75% from 4 tests

An overview of server-side resources used by Advanced Classifieds & Directory Pro
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,685.30ms on /wp-admin/admin.php?page=advanced-classifieds-and-directory-pro)
PageMemory (MB)CPU Time (ms)
Home /4.47 ▲1.0050.46 ▲6.66
Dashboard /wp-admin4.87 ▲1.52103.54 ▲41.96
Posts /wp-admin/edit.php4.91 ▲1.5577.62 ▲25.57
Add New Post /wp-admin/post-new.php7.46 ▲1.5798.24 ▼8.08
Media Library /wp-admin/upload.php4.77 ▲1.5455.50 ▲16.93
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius5.1656.05
Dashboard /wp-admin/admin.php?page=advanced-classifieds-and-directory-pro5.131,685.30
Custom Fields /wp-admin/edit.php?post_type=acadp_fields4.8459.36
Categories /wp-admin/edit-tags.php?taxonomy=acadp_categories&post_type=acadp_listings4.8253.81
All Listings /wp-admin/edit.php?post_type=acadp_listings4.8458.23
Settings /wp-admin/admin.php?page=acadp_settings4.8050.71
Locations /wp-admin/edit-tags.php?taxonomy=acadp_locations&post_type=acadp_listings4.7951.98
Payment History /wp-admin/edit.php?post_type=acadp_payments4.8454.68

Server storage [IO: ▲6.17MB] [DB: ▲0.03MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 403 new files
Database: no new tables, 47 new options
New WordPress options
acadp_email_template_order_completed
acadp_gateway_settings
acadp_page_settings
acadp_registration_settings
acadp_featured_listing_settings
acadp_email_template_listing_contact
db_upgraded
widget_recent-posts
acadp_misc_settings
acadp_email_template_listing_submitted
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Classifieds & Directory Pro
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,011 ▲25014.86 ▲0.631.92 ▲0.3232.03 ▼14.65
Dashboard /wp-admin2,405 ▲2286.25 ▲0.58123.79 ▲22.4163.97 ▲23.45
Posts /wp-admin/edit.php2,337 ▲2373.37 ▲1.3556.27 ▲19.3139.22 ▲6.49
Add New Post /wp-admin/post-new.php6,446 ▲4,90929.09 ▲10.74962.42 ▲332.7538.27 ▼27.62
Media Library /wp-admin/upload.php1,476 ▲824.06 ▼0.1286.81 ▼13.2647.37 ▲0.55
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,3053.0443.4527.45
Dashboard /wp-admin/admin.php?page=advanced-classifieds-and-directory-pro1,1913.2644.6297.56
Custom Fields /wp-admin/edit.php?post_type=acadp_fields1,3843.5248.6730.95
Categories /wp-admin/edit-tags.php?taxonomy=acadp_categories&post_type=acadp_listings1,5753.5252.0434.23
All Listings /wp-admin/edit.php?post_type=acadp_listings1,4413.8453.7031.26
Settings /wp-admin/admin.php?page=acadp_settings1,3463.2044.4131.82
Locations /wp-admin/edit-tags.php?taxonomy=acadp_locations&post_type=acadp_listings1,5513.8246.7532.49
Payment History /wp-admin/edit.php?post_type=acadp_payments1,4743.4845.5329.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/advanced-classifieds-and-directory-pro/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 16 options in the database
    • can_compress_scripts
    • widget_advanced-classifieds-and-directory-pro-widget-listing-address
    • widget_advanced-classifieds-and-directory-pro-widget-listing-video
    • widget_advanced-classifieds-and-directory-pro-widget-listing-contact
    • widget_advanced-classifieds-and-directory-pro-widget-categories
    • widget_advanced-classifieds-and-directory-pro-widget-search
    • fs_debug_mode
    • db_upgraded
    • widget_recent-comments
    • fs_accounts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/advanced-classifieds-and-directory-pro/widgets/locations/views/acadp-widget-public-locations-display.php
    • > /wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/listings/acadp-admin-listing-images-display.php
    • > /wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/categories/acadp-admin-image-field-display.php
    • > /wp-content/plugins/advanced-classifieds-and-directory-pro/widgets/categories/views/acadp-widget-public-categories-display.php
    • > /wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/listings/acadp-admin-custom-fields-display.php
    • > /wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/listings/acadp-admin-listing-video-display.php
  • 131× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/search/acadp-public-custom-fields-vertical-display.php:19
    • > PHP Notice
      Undefined variable: acadp_query in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/listings/acadp-public-listings-list-display.php on line 99
    • > PHP Notice
      Undefined variable: terms in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/categories/acadp-public-categories-text-list-display.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/registration/acadp-public-register-display.php:23
    • > PHP Notice
      Undefined variable: acadp_query in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/listings/acadp-public-listings-map-display.php on line 100
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/registration/acadp-public-login-display.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/listings/acadp-public-listings-list-display.php:99
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/categories/acadp-public-categories-text-list-display.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/listings/acadp-admin-listing-images-display.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/registration/acadp-public-password-reset-display.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: directory, job listing, business directory, listings, real estate...

advanced-classifieds-and-directory-pro/acadp.php 85% from 13 tests

The main PHP script in "Advanced Classifieds & Directory Pro" version 2.1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 191 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-classifieds-and-directory-pro.php" instead of "acadp.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected91,921 lines of code in 278 files:
LanguageFilesBlank linesComment linesLines of code
PHP21311,26621,36650,350
JSON120028,158
CSS223161598,818
JavaScript276879622,646
SVG2011,815
XML100133
HTML1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity75.77
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity5.07
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes82
▷ Abstract classes22.44%
▷ Concrete classes8097.56%
▷ Final classes00.00%
Methods1,534
▷ Static methods20013.04%
▷ Public methods1,11672.75%
▷ Protected methods171.11%
▷ Private methods40126.14%
Functions220
▷ Named functions220100.00%
▷ Anonymous functions00.00%
Constants153
▷ Global constants10669.28%
▷ Class constants4730.72%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/no-image.png2.87KB1.13KB▼ 60.67%
vendor/markerclusterer/images/m4.png5.57KB4.23KB▼ 24.08%
vendor/markerclusterer/images/m1.png2.93KB2.20KB▼ 25.07%
admin/images/logo.png1.16KB1.15KB0.34%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%