83% brainity-boost-ads

Code Review | Brainity: Prospecting and Retargeting Ads on Autopilot

WordPress plugin Brainity: Prospecting and Retargeting Ads on Autopilot scored 83% from 54 tests.

About plugin

  • Plugin page: brainity-boost-ads
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.1-5.6
  • WordPress version: 5.9.2
  • First release: Aug 30, 2019
  • Latest release: Jan 27, 2021
  • Number of updates: 68
  • Update frequency: every 7.6 days
  • Top authors: xevibrainity (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active / 1,144 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.75MB] [CPU: ▼330.28ms] 75% from 4 tests

An overview of server-side resources used by Brainity: Prospecting and Retargeting Ads on Autopilot
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,188.33ms on /wp-admin/admin.php?page=brainity-go-to-manager)
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.3960.16 ▲8.69
Dashboard /wp-admin3.52 ▲0.1122.09 ▼10.89
Posts /wp-admin/edit.php3.64 ▼0.0025.91 ▼10.18
Add New Post /wp-admin/post-new.php3.57 ▼3.4030.96 ▼1,296.58
Media Library /wp-admin/upload.php3.58 ▲0.2921.60 ▼3.46
Brainity /wp-admin/admin.php?page=brainity-go-to-manager3.711,188.33

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: 1 new table, 1 new option
New tables
wp_brainity
New WordPress options
brainity_db_version

Browser metrics Passed 4 tests

Checking browser requirements for Brainity: Prospecting and Retargeting Ads on Autopilot
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲2916.07 ▲0.105.88 ▲0.042.10 ▼0.61
Dashboard /wp-admin2,911 ▲506.18 ▼0.03122.25 ▼16.90170.26 ▲9.10
Posts /wp-admin/edit.php2,707 ▲133.25 ▲0.0263.00 ▼1.22142.72 ▼0.14
Add New Post /wp-admin/post-new.php1,794 ▲13322.14 ▲5.42420.26 ▼4.10194.15 ▲34.16
Media Library /wp-admin/upload.php1,716 ▲185.50 ▼0.04125.16 ▼18.38213.70 ▲22.25
Brainity /wp-admin/admin.php?page=brainity-go-to-manager9722.4051.6273.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • brainity_db_version

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=brainity-go-to-manager
    • > Notice in wp-content/plugins/brainity-boost-ads/brainity.php+406
    Trying to get property 'pixel_id' of non-object
    • > GET request to /wp-admin/admin.php?page=brainity-go-to-manager
    • > Notice in wp-content/plugins/brainity-boost-ads/brainity.php+312
    Trying to get property 'sso_token' of non-object
    • > GET request to /wp-admin/admin.php?page=brainity-go-to-manager
    • > Warning in wp-content/plugins/brainity-boost-ads/brainity.php+312
    Cannot modify header information - headers already sent by (output started at wp-admin/includes/misc.php:1013)

SRP Passed 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
The SRP test was a success

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 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5 in brainity-boost-ads/assets to your readme.txt
Please take inspiration from this readme.txt

brainity-boost-ads/brainity.php 85% from 13 tests

The primary PHP file in "Brainity: Prospecting and Retargeting Ads on Autopilot" version 1.0.14 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("brainity-boost-ads.php" instead of "brainity.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 153 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,365 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP83704092,207
CSS210871
SVG118053
JavaScript15134

PHP code Passed 2 tests

An overview 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.38
Average class complexity46.50
▷ Minimum class complexity12.00
▷ Maximum class complexity104.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods126
▷ Static methods7458.73%
▷ Public methods11893.65%
▷ Protected methods00.00%
▷ Private methods86.35%
Functions9
▷ Named functions00.00%
▷ Anonymous functions9100.00%
Constants51
▷ Global constants611.76%
▷ Class constants4588.24%
▷ Public constants45100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.88MB with 0.56MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/facebook.png16.01KB6.31KB▼ 60.55%
assets/img/brainity-logo.png16.90KB6.16KB▼ 63.56%
assets/screenshot-5.png147.77KB45.90KB▼ 68.94%
assets/screenshot-4.png161.58KB66.29KB▼ 58.97%
assets/icon-256x256.png19.92KB6.94KB▼ 65.15%