88% ads-bbpress

Code Review | Ads for bbPress

WordPress plugin Ads for bbPress scored 88% from 54 tests.

About plugin

  • Plugin page: ads-bbpress
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.8.1
  • First release: Feb 13, 2017
  • Latest release: Aug 28, 2021
  • Number of updates: 11
  • Update frequency: every 150.7 days
  • Top authors: satollo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active / 1,821 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼142.58ms] Passed 4 tests

An overview of server-side resources used by Ads for bbPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1533.30 ▲8.25
Dashboard /wp-admin3.10 ▲0.0552.41 ▲8.15
Posts /wp-admin/edit.php3.19 ▲0.0845.21 ▼0.51
Add New Post /wp-admin/post-new.php5.46 ▲0.0384.46 ▼580.35
Media Library /wp-admin/upload.php3.04 ▲0.0436.75 ▲2.39
Ads for bbPRess /wp-admin/options-general.php?page=ads-bbpress/index.php3.0729.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Ads for bbPress: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8916.28 ▲0.348.80 ▼0.2448.12 ▲1.55
Dashboard /wp-admin2,972 ▲385.84 ▼0.14144.91 ▼10.46106.82 ▼0.18
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0072.09 ▼0.1295.56 ▼1.40
Add New Post /wp-admin/post-new.php1,686 ▲318.76 ▲2.49420.24 ▼14.56108.90 ▼7.00
Media Library /wp-admin/upload.php1,812 ▲55.08 ▲0.06167.87 ▲9.23109.99 ▼2.13
Ads for bbPRess /wp-admin/options-general.php?page=ads-bbpress/index.php2,1793.88119.06158.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=ads-bbpress/index.php
    • > Notice in wp-content/plugins/ads-bbpress/controls.php+11
    Undefined index: options
    • > GET request to /wp-admin/options-general.php?page=ads-bbpress/index.php
    • > Notice in wp-content/plugins/ads-bbpress/controls.php+14
    Undefined index: act

SRP 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-bbpress/plugin.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: bbpress, adsense, ads, monetize, affiliate

ads-bbpress/plugin.php 92% from 13 tests

This is the main PHP file of "Ads for bbPress" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ads-bbpress.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin450 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP49037450

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.33
▷ Minimum class complexity3.00
▷ Maximum class complexity24.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods35100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected