10% house-ads

Code Review | House Ads

WordPress plugin House Ads scored10%from 54 tests.

About plugin

  • Plugin page: house-ads
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0.2
  • WordPress version: 6.3.1
  • First release: Dec 28, 2018
  • Latest release: Dec 29, 2018
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: mrtolix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /544 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Parse error in wp-content/plugins/house-ads/core/Shortcode.php+59
    syntax error, unexpected '}', expecting end of file

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

A check of server-side resources used by House Ads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.90 ▼2.26
Dashboard /wp-admin3.31 ▼0.0444.58 ▼12.41
Posts /wp-admin/edit.php3.36 ▲0.0048.63 ▲3.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.05 ▼17.27
Media Library /wp-admin/upload.php3.23 ▲0.0036.71 ▲3.51

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

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

Browser metrics Passed 4 tests

House Ads: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.29 ▼1.381.72 ▼0.1342.22 ▲0.60
Dashboard /wp-admin2,209 ▲204.85 ▼0.11106.41 ▼0.2139.46 ▼6.12
Posts /wp-admin/edit.php2,089 ▲31.99 ▼0.0338.99 ▲3.1834.76 ▲0.88
Add New Post /wp-admin/post-new.php1,538 ▲2423.36 ▲5.78665.22 ▲13.3256.86 ▲6.20
Media Library /wp-admin/upload.php1,388 ▲34.18 ▼0.0594.55 ▼14.0443.17 ▼3.07

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 124× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/house-ads/lib/acf/includes/forms/._form-attachment.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/admin/._admin.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/admin/tools/._class-acf-admin-tool-export.php
    • > /wp-content/plugins/house-ads/lib/acf/._acf.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/._compatibility.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/._json.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/fields/._class-acf-field-email.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/walkers/._class-acf-walker-nav-menu-edit.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/fields/._class-acf-field-page_link.php
    • > /wp-content/plugins/house-ads/lib/acf/includes/locations/._class-acf-location-page-type.php
  • 72× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/house-ads/lib/acf/includes/forms/form-attachment.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/house-ads/lib/acf/includes/fields/class-acf-field-oembed.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/house-ads/lib/acf/includes/admin/settings-info.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/house-ads/lib/acf/includes/fields/class-acf-field-tab.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/house-ads/core/custom_post.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/house-ads/lib/inc.php:4
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/house-ads/lib/acf/includes/admin/views/field-group-field.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/house-ads/lib/acf/includes/admin/views/html-location-rule.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/house-ads/lib/acf/includes/fields/class-acf-field-select.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_get_setting() in wp-content/plugins/house-ads/lib/acf/includes/admin/views/html-notice-upgrade.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
Please fix the following attributes:
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

house-ads/house-ads.php Passed 13 tests

The entry point to "House Ads" version 1.0.0 is a PHP file that has certain tags in its header comment area
61 characters long description:
Plugin to show in house ads on your post or page by shortcode

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected86,431 lines of code in 183 files:
LanguageFilesBlank linesComment linesLines of code
PO File2820,74533,44643,377
JavaScript136,6056,36121,846
PHP12712,85216,82215,496
CSS132158255,558
JSON100124
SVG118030

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.34
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes103
▷ Abstract classes00.00%
▷ Concrete classes103100.00%
▷ Final classes00.00%
Methods663
▷ Static methods00.00%
▷ Public methods663100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions373
▷ Named functions373100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/acf/assets/images/acf-logo.png3.40KB3.39KB0.23%
(invalid) lib/acf/assets/inc/select2/3/._select2.png4.00KB0.00KB▼ 100.00%
(invalid) lib/acf/assets/inc/datepicker/images/._ui-icons_444444_256x240.png4.00KB0.00KB▼ 100.00%
(invalid) lib/acf/assets/inc/select2/3/._select2x2.png4.00KB0.00KB▼ 100.00%
lib/acf/assets/inc/select2/3/select2x2.png0.64KB0.77KB0.00%