73% chatpressai

Code Review | ChatPressAI - AI Supported Blogging and Reasearch

WordPress plugin ChatPressAI - AI Supported Blogging and Reasearch scored73%from 54 tests.

About plugin

  • Plugin page: chatpressai
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jan 9, 2023
  • Latest release: Nov 1, 2023
  • Number of updates: 12
  • Update frequency: every 24.9 days
  • Top authors: blackandwhitedigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /300 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.39MB] [CPU: ▲23.86ms] 75% from 4 tests

An overview of server-side resources used by ChatPressAI - AI Supported Blogging and Reasearch
Please have a look at the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.39MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.24 ▲5.7770.53 ▲29.33
Dashboard /wp-admin9.26 ▲5.9172.69 ▲11.56
Posts /wp-admin/edit.php9.26 ▲5.9073.83 ▲22.16
Add New Post /wp-admin/post-new.php9.89 ▲4.00124.86 ▲32.37
Media Library /wp-admin/upload.php9.26 ▲6.0268.21 ▲33.20
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2657.39

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 209 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
fs_active_plugins
fs_accounts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
fs_debug_mode
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for ChatPressAI - AI Supported Blogging and Reasearch
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲16513.33 ▼0.938.15 ▲6.4830.82 ▼12.53
Dashboard /wp-admin2,234 ▲575.59 ▲0.0290.92 ▲2.2044.14 ▲2.24
Posts /wp-admin/edit.php2,137 ▲342.00 ▼0.0238.61 ▼0.7335.02 ▼4.46
Add New Post /wp-admin/post-new.php1,590 ▲6422.72 ▼0.16623.62 ▼133.4665.73 ▲1.52
Media Library /wp-admin/upload.php1,436 ▲334.16 ▼0.0697.93 ▼3.8847.23 ▲4.27
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0881.6930.1431.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/chatpressai/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • theysaidso_admin_options
    • fs_accounts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • fs_debug_mode
    • widget_recent-posts
    • fs_active_plugins
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/chatpressai/admin/partials/chatpressai-admin-display.php
    • > /wp-content/plugins/chatpressai/public/partials/chatpressai-public-display.php

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: openai, chatgpt, ai

chatpressai/chatpressai.php 92% from 13 tests

The principal PHP file in "ChatPressAI - AI Supported Blogging and Reasearch" v. 1.0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 415 characters long)

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected34,880 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1398,33818,30134,269
JavaScript53959360
CSS15498246
JSON1005

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity72.81
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes63
▷ Abstract classes23.17%
▷ Concrete classes6196.83%
▷ Final classes00.00%
Methods1,349
▷ Static methods22016.31%
▷ Public methods94169.76%
▷ Protected methods171.26%
▷ Private methods39128.98%
Functions106
▷ Named functions10498.11%
▷ Anonymous functions21.89%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%