74% targetaudience

Code Review | TargetAudience

WordPress plugin TargetAudience scored74%from 54 tests.

About plugin

  • Plugin page: targetaudience
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.0.3
  • WordPress version: 6.3.1
  • First release: Feb 11, 2019
  • Latest release: Feb 12, 2019
  • Number of updates: 33
  • Update frequency: every 0.0 days
  • Top authors: marketerbase (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /522 total downloads

Benchmarks

Plugin footprint 65% 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: ▼0.18MB] [CPU: ▼15.85ms] Passed 4 tests

This is a short check of server-side resources used by TargetAudience
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7321.51 ▼21.14
Dashboard /wp-admin3.32 ▼0.0349.64 ▼18.89
Posts /wp-admin/edit.php3.37 ▲0.0153.97 ▼4.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.03 ▼19.26
Media Library /wp-admin/upload.php3.24 ▲0.0137.13 ▼1.91
Audiences /wp-admin/options-general.php?page=wpta_audiences_page3.2234.40

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: 1 new table, 6 new options
New tables
wp_wpta_audiences
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by TargetAudience
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲2214.77 ▲0.462.10 ▲0.0046.65 ▲2.04
Dashboard /wp-admin2,199 ▲255.54 ▼0.1788.61 ▼15.7638.17 ▼5.10
Posts /wp-admin/edit.php2,104 ▲42.03 ▼0.0339.86 ▲2.6736.27 ▲0.54
Add New Post /wp-admin/post-new.php1,529 ▲317.51 ▼0.10694.56 ▲23.0354.84 ▼3.13
Media Library /wp-admin/upload.php1,398 ▲14.26 ▼0.0199.68 ▼16.5041.33 ▼7.40
Audiences /wp-admin/options-general.php?page=wpta_audiences_page1,0302.0424.0929.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_wpta_audiences
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/targetaudience/inc/wpta-admin.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/targetaudience/inc/class-wpta-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/targetaudience/inc/class-wpta-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/targetaudience/inc/class-wpta-table.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
3 plugin tags: segmentation, bouncing, conversion

targetaudience/targetaudience.php Passed 13 tests

Analyzing the main PHP file in "TargetAudience" version 1.0
72 characters long description:
TargetAudience helps you to target your website audience more effective.

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
There were no executable files found in this plugin568 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP56812374
PO File1358893
JavaScript16055
CSS12046

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity6.67
▷ Minimum class complexity3.00
▷ Maximum class complexity10.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin