79% wpadverts

Code Review | WPAdverts - Classifieds Plugin

WordPress plugin WPAdverts - Classifieds Plugin scored79%from 54 tests.

About plugin

  • Plugin page: wpadverts
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Aug 16, 2015
  • Latest release: Nov 15, 2023
  • Number of updates: 135
  • Update frequency: every 22.4 days
  • Top authors: gwin (100%)

Code review

54 tests

User reviews

154 reviews

Install metrics

7,000+ active /372,694 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
Installer ran successfully

Server metrics [RAM: ▲1.75MB] [CPU: ▲17.08ms] Passed 4 tests

Server-side resources used by WPAdverts - Classifieds Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.08 ▲1.6160.87 ▲16.29
Dashboard /wp-admin5.12 ▲1.81106.66 ▲58.34
Posts /wp-admin/edit.php5.19 ▲1.8367.07 ▲22.29
Add New Post /wp-admin/post-new.php8.00 ▲2.11103.58 ▲9.64
Media Library /wp-admin/upload.php4.97 ▲1.7452.83 ▲20.11
Add New /wp-admin/post-new.php?post_type=advert5.1874.33
Options /wp-admin/edit.php?post_type=advert&page=adverts-extensions4.9647.01
Categories /wp-admin/edit-tags.php?taxonomy=advert_category&post_type=advert5.0449.11
All Classifieds /wp-admin/edit.php?post_type=advert5.1152.56

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 294 new files
Database: no new tables, 13 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
adverts_config
widget_wpadverts-widget-ads
can_compress_scripts
adverts_moderate
advert_category_children
adverts_gallery
widget_wpadverts-widget-categories
...

Browser metrics Passed 4 tests

WPAdverts - Classifieds Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6814.27 ▲0.001.82 ▲0.0843.86 ▼0.71
Dashboard /wp-admin2,233 ▲525.61 ▼0.0591.80 ▼20.5040.45 ▼5.40
Posts /wp-admin/edit.php2,138 ▲351.94 ▼0.0439.28 ▲3.7335.89 ▲2.39
Add New Post /wp-admin/post-new.php6,302 ▲4,77619.74 ▼3.521,095.04 ▲430.8043.06 ▼8.32
Media Library /wp-admin/upload.php1,438 ▲384.26 ▲0.02100.63 ▲3.1942.47 ▼1.79
Add New /wp-admin/post-new.php?post_type=advert2,8648.18222.8591.24
Options /wp-admin/edit.php?post_type=advert&page=adverts-extensions1,5401.9924.6935.02
Categories /wp-admin/edit-tags.php?taxonomy=advert_category&post_type=advert1,4172.2528.3232.94
All Classifieds /wp-admin/edit.php?post_type=advert1,2182.4948.3629.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • widget_wpadverts-widget-ads
    • widget_recent-posts
    • db_upgraded
    • wpadverts_block_templates_global_method
    • can_compress_scripts
    • widget_wpadverts-widget-categories
    • widget_recent-comments
    • widget_theysaidso_widget
    • advert_category_children

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
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wpadverts/blocks/single-data-table/templates/grid.php
    • > /wp-content/plugins/wpadverts/blocks/single-contact/templates/contact.php
    • > /wp-content/plugins/wpadverts/blocks/categories/templates/categories-all.php
    • > /wp-content/plugins/wpadverts/blocks/single-data-table/templates/text.php
    • > /wp-content/plugins/wpadverts/blocks/list/templates/list.php
    • > /wp-content/plugins/wpadverts/blocks/single-data-table/templates/list.php
  • 126× 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/wpadverts/blocks/single-data-table/templates/list.php on line 2
    • > PHP Notice
      Undefined variable: data_table in wp-content/plugins/wpadverts/blocks/single-data-table/templates/grid.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Adext_Emails' not found in wp-content/plugins/wpadverts/addons/emails/emails.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wpadverts/templates/list.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpadverts/addons/contact-form/contact-form.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wpadverts/addons/bank-transfer/admin/options.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/wpadverts/addons/core/admin/types-edit-post.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wpadverts/templates/manage-edit.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpadverts/blocks/single-contact/templates/contact.php on line 1
    • > PHP Notice
      Undefined variable: data_table in wp-content/plugins/wpadverts/blocks/single-data-table/templates/list.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: classified script, wp classifieds, classifieds, classified ads, classified...

wpadverts/wpadverts.php Passed 13 tests

Analyzing the main PHP file in "WPAdverts - Classifieds Plugin" version 2.1.1
56 characters long description:
The lightweight WordPress classifieds plugin done right.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected56,822 lines of code in 256 files:
LanguageFilesBlank linesComment linesLines of code
PHP1505,5596,43820,816
PO File188,0029,37319,369
CSS198041848,493
JavaScript341,3476766,718
JSON1230718
SVG236740708

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.85
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes47
▷ Abstract classes00.00%
▷ Concrete classes47100.00%
▷ Final classes00.00%
Methods417
▷ Static methods235.52%
▷ Public methods36487.29%
▷ Protected methods5112.23%
▷ Private methods20.48%
Functions323
▷ Named functions32299.69%
▷ Anonymous functions10.31%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/swipebox-icons.png0.71KB0.43KB▼ 39.64%
assets/images/icon-arrow-down.png0.16KB0.20KB0.00%