68% ainow

Code Review | AINow

WordPress plugin AINow scored68%from 54 tests.

About plugin

  • Plugin page: ainow
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Oct 20, 2016
  • Latest release: May 22, 2020
  • Number of updates: 9
  • Update frequency: every 145.6 days
  • Top authors: GeroNikolov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /854 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
This plugin's installer ran successfully

Server metrics [RAM: ▼4.43MB] [CPU: ▼911,210.38ms] Passed 4 tests

Server-side resources used by AINow
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▼18.0242.11 ▼3,644,832.73
Dashboard /wp-admin21.62 ▲18.233,653,259.89 ▲3,653,195.42
Posts /wp-admin/edit.php3.54 ▲0.1455.20 ▲3.51
Add New Post /wp-admin/post-new.php6.03 ▲0.1094.06 ▼16.49
Media Library /wp-admin/upload.php3.35 ▲0.0841.80 ▲4.19
AINOW Statistics /wp-admin/options-general.php?page=ainow-statistics3.32174.23

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: 1 new table, 6 new options
New tables
wp_ainow_users
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for AINow
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲14813.54 ▼0.6912.59 ▲10.8842.80 ▼0.47
Dashboard /wp-admin2,203 ▲255.55 ▼0.1088.14 ▼28.7839.65 ▼5.62
Posts /wp-admin/edit.php2,111 ▲112.01 ▲0.0036.13 ▲2.2135.50 ▲0.04
Add New Post /wp-admin/post-new.php1,532 ▲623.66 ▲0.56680.60 ▼56.2571.62 ▲8.83
Media Library /wp-admin/upload.php1,405 ▲54.18 ▼0.0296.19 ▼19.7841.35 ▼9.63
AINOW Statistics /wp-admin/options-general.php?page=ainow-statistics8872.0524.7629.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_ainow_users
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ainow-statistics
    • > Notice in wp-content/plugins/ainow/ainow_statistics.php+50
    Undefined index: country
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ainow-statistics
    • > Notice in wp-content/plugins/ainow/ainow_statistics.php+51
    Undefined index: city
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ainow-statistics
    • > Notice in wp-content/plugins/ainow/ainow_statistics.php+52
    Undefined index: regionName
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ainow-statistics
    • > Notice in wp-content/plugins/ainow/ainow_statistics.php+53
    Undefined index: zip
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ainow-statistics
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ainow-statistics
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP 50% 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/ainow/ainow_statistics.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ainow/ainow.php:24
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/ainow/ainow_statistics.php on line 38

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: You should set the name of your plugin on the first line ( === ainow === )
The official readme.txt is a good inspiration

ainow/ainow.php 92% from 13 tests

The principal PHP file in "AINow" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 213 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
Good job! No executable or dangerous file extensions detected596 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP28657392
CSS27376
JavaScript26965
Sass29163

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity61.00
▷ Minimum class complexity61.00
▷ Maximum class complexity61.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin