84% agentpress-listings

Code Review | AgentPress Listings

WordPress plugin AgentPress Listings scored84%from 54 tests.

About plugin

  • Plugin page: agentpress-listings
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 1, 2011
  • Latest release: Aug 7, 2023
  • Number of updates: 60
  • Update frequency: every 72.6 days
  • Top authors: nathanrice (66.67%)studiopress (16.67%)wpmuguru (15%)Nick_theGeek (6.67%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /100,392 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
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.96ms] Passed 4 tests

Server-side resources used by AgentPress Listings
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0053.06 ▲2.99
Dashboard /wp-admin3.31 ▼0.0450.99 ▼16.03
Posts /wp-admin/edit.php3.36 ▲0.0051.76 ▲1.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.92 ▼17.04
Media Library /wp-admin/upload.php3.23 ▲0.0037.40 ▼0.65

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for AgentPress Listings
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.372.13 ▲0.0542.19 ▲1.10
Dashboard /wp-admin2,195 ▲185.53 ▲0.0086.43 ▼8.4740.15 ▼3.45
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0040.99 ▲3.3435.14 ▼4.68
Add New Post /wp-admin/post-new.php1,526 ▼223.08 ▼0.04680.85 ▼19.1359.95 ▲6.76
Media Library /wp-admin/upload.php1,400 ▼04.21 ▼0.0199.11 ▼11.7243.58 ▼4.81

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/agentpress-listings/includes/views/create-tax.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/agentpress-listings/includes/class-agentpress-listings-search-widget.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/agentpress-listings/plugin.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/agentpress-listings/includes/views/edit-tax.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/agentpress-listings/includes/views/listing-details-metabox.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/agentpress-listings/includes/class-agentpress-featured-listings-widget.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === agentpress-listings === )
The official readme.txt is a good inspiration

agentpress-listings/plugin.php 92% from 13 tests

The entry point to "AgentPress Listings" version 1.3.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("agentpress-listings.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,009 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9322372843
JavaScript218876
JSON20069
YAML13019
Markdown1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity24.25
▷ Minimum class complexity11.00
▷ Maximum class complexity41.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods3397.06%
▷ Protected methods12.94%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin