67% advanced-classifieds-and-directory-pro

Code Review | Advanced Classifieds & Directory Pro

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

About plugin

  • Plugin page: advanced-classifi...
  • Plugin version: 1.8.8
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.9
  • WordPress version: 5.9.2
  • First release: May 11, 2016
  • Latest release: Mar 1, 2022
  • Number of updates: 83
  • Update frequency: every 25.6 days
  • Top authors: pluginsware (100%)

Code review

54 tests

User reviews

87 reviews

Install metrics

4,000+ active / 130,317 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲6.52MB] [CPU: ▼255.81ms] 25% from 4 tests

A check of server-side resources used by Advanced Classifieds & Directory Pro
The following require your attention
  • RAM: Total memory usage must be kept under 10MB (currently 10.08MB on /wp-admin/edit.php?post_type=acadp_payments)
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,784.73ms on /wp-admin/admin.php?page=advanced-classifieds-and-directory-pro)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 6.52MB on /wp-admin/edit.php?post_type=acadp_payments)
PageMemory (MB)CPU Time (ms)
Home /9.65 ▲6.1496.22 ▲47.76
Dashboard /wp-admin10.08 ▲6.67142.47 ▲99.59
Posts /wp-admin/edit.php10.32 ▲6.6778.94 ▲40.61
Add New Post /wp-admin/post-new.php13.59 ▲6.62130.68 ▼1,148.64
Media Library /wp-admin/upload.php9.94 ▲6.6561.41 ▲37.05
Settings /wp-admin/admin.php?page=acadp_settings9.9566.49
Custom Fields /wp-admin/edit.php?post_type=acadp_fields10.0869.41
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius10.2060.83
Categories /wp-admin/edit-tags.php?taxonomy=acadp_categories&post_type=acadp_listings9.9764.06
All Listings /wp-admin/edit.php?post_type=acadp_listings10.0866.05
Locations /wp-admin/edit-tags.php?taxonomy=acadp_locations&post_type=acadp_listings9.9763.30
Dashboard /wp-admin/admin.php?page=advanced-classifieds-and-directory-pro10.231,784.73
Payment History /wp-admin/edit.php?post_type=acadp_payments10.0872.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 380 new files
Database: no new tables, 40 new options
New WordPress options
acadp_email_settings
acadp_featured_listing_settings
acadp_categories_settings
fs_gdpr
acadp_email_template_order_created_offline
acadp_registration_settings
widget_advanced-classifieds-and-directory-pro-widget-search
acadp_email_template_order_created
widget_advanced-classifieds-and-directory-pro-widget-categories
widget_advanced-classifieds-and-directory-pro-widget-listing-address
...

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Classifieds & Directory Pro
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,152 ▲39817.51 ▲1.826.08 ▲0.322.54 ▼0.23
Dashboard /wp-admin3,190 ▲3358.03 ▲1.84143.63 ▲9.58169.70 ▲5.93
Posts /wp-admin/edit.php3,018 ▲3275.10 ▲1.8680.92 ▲14.45158.18 ▲9.76
Add New Post /wp-admin/post-new.php1,830 ▲7820.67 ▼0.81428.53 ▼17.51170.92 ▲10.87
Media Library /wp-admin/upload.php1,804 ▲1065.54 ▼0.02108.54 ▼34.97207.54 ▲17.85
Settings /wp-admin/admin.php?page=acadp_settings1,6534.6169.93153.73
Custom Fields /wp-admin/edit.php?post_type=acadp_fields1,8175.0777.78131.45
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,7464.3670.16109.50
Categories /wp-admin/edit-tags.php?taxonomy=acadp_categories&post_type=acadp_listings2,0205.1689.71138.65
All Listings /wp-admin/edit.php?post_type=acadp_listings1,8665.2578.73140.26
Locations /wp-admin/edit-tags.php?taxonomy=acadp_locations&post_type=acadp_listings1,9865.0678.03137.35
Dashboard /wp-admin/admin.php?page=advanced-classifieds-and-directory-pro1,5914.8079.41185.77
Payment History /wp-admin/edit.php?post_type=acadp_payments1,8875.1376.56137.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/advanced-classifieds-and-directory-pro/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • widget_advanced-classifieds-and-directory-pro-widget-listing-address
    • widget_advanced-classifieds-and-directory-pro-widget-search
    • fs_accounts
    • widget_advanced-classifieds-and-directory-pro-widget-categories
    • fs_gdpr
    • fs_active_plugins
    • fs_debug_mode
    • widget_advanced-classifieds-and-directory-pro-widget-locations
    • widget_advanced-classifieds-and-directory-pro-widget-listing-contact
    • widget_advanced-classifieds-and-directory-pro-widget-listings
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /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/widgets/locations/views/acadp-widget-public-locations-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
    • > /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
  • 131× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/advanced-classifieds-and-directory-pro/widgets/locations/views/acadp-widget-public-locations-display.php on line 14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/settings/acadp-admin-settings-display.php:13
    • > 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/user/acadp-public-custom-fields-display.php:14
    • > PHP Notice
      Undefined variable: terms in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/locations/acadp-public-locations-display.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-classifieds-and-directory-pro/admin/partials/listings/acadp-admin-contact-details-display.php:17
    • > PHP Notice
      Undefined variable: acadp_query in wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/user/acadp-public-custom-fields-display.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-classifieds-and-directory-pro/widgets/categories/views/acadp-widget-admin-categories-display.php:14
    • > PHP Warning
      Division by zero in wp-content/plugins/advanced-classifieds-and-directory-pro/widgets/listings/views/acadp-widget-public-listings-media-display.php on line 22
    • > 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:14
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: classifieds, business directory, listings, real estate, job listing...

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

The principal PHP file in "Advanced Classifieds & Directory Pro" v. 1.8.8 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 191 characters long)
  • Main file name: Please rename the main PHP file in this plugin to 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 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected65,681 lines of code in 253 files:
LanguageFilesBlank linesComment linesLines of code
PHP19810,40920,15046,979
CSS222891648,632
JSON3007,080
JavaScript276979672,695
SVG100288
Sass1006
HTML1001

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity72.34
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity5.14
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes79
▷ Abstract classes22.53%
▷ Concrete classes7797.47%
▷ Final classes00.00%
Methods1,394
▷ Static methods17612.63%
▷ Public methods1,03073.89%
▷ Protected methods151.08%
▷ Private methods34925.04%
Functions213
▷ Named functions213100.00%
▷ Anonymous functions00.00%
Constants130
▷ Global constants10580.77%
▷ Class constants2519.23%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
vendor/markerclusterer/images/m5.png6.68KB5.10KB▼ 23.66%
vendor/markerclusterer/images/m4.png5.57KB4.23KB▼ 24.08%
public/images/no-image.png2.87KB1.13KB▼ 60.67%
vendor/markerclusterer/images/m2.png3.18KB2.36KB▼ 25.77%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%