77% newsletter-page-redirects

Code Review | AI Magic - SEO Content Generator & Article Writer

WordPress plugin AI Magic - SEO Content Generator & Article Writer scored77%from 54 tests.

About plugin

  • Plugin page: newsletter-page-r...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: May 4, 2018
  • Latest release: Nov 24, 2023
  • Number of updates: 45
  • Update frequency: every 45.1 days
  • Top authors: yasinkuyu (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active /663 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.92ms] Passed 4 tests

Analyzing server-side resources used by AI Magic - SEO Content Generator & Article Writer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1643.28 ▼3.52
Dashboard /wp-admin3.47 ▲0.1646.51 ▼4.13
Posts /wp-admin/edit.php3.58 ▲0.2250.81 ▲2.01
Add New Post /wp-admin/post-new.php6.07 ▲0.1891.80 ▼5.66
Media Library /wp-admin/upload.php3.39 ▲0.1533.65 ▼2.36
History /wp-admin/edit.php?post_type=ai_magic_logs3.4349.91
Subscription /wp-admin/admin.php?page=ai-magic-subscription3.3631.20
Settings /wp-admin/admin.php?page=ai-magic-settings3.5338.18

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 216 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by AI Magic - SEO Content Generator & Article Writer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲18113.41 ▼0.937.98 ▲6.0341.36 ▼13.02
Dashboard /wp-admin2,237 ▲605.69 ▲0.0592.21 ▲2.3475.21 ▲36.10
Posts /wp-admin/edit.php2,145 ▲421.97 ▼0.0434.71 ▼2.9434.00 ▼3.74
Add New Post /wp-admin/post-new.php1,594 ▲6822.97 ▼0.01710.81 ▲132.9458.45 ▲5.93
Media Library /wp-admin/upload.php1,442 ▲394.13 ▼0.0598.62 ▲5.1477.81 ▲32.59
History /wp-admin/edit.php?post_type=ai_magic_logs1,1711.9737.5532.33
Subscription /wp-admin/admin.php?page=ai-magic-subscription9382.0125.4629.26
Settings /wp-admin/admin.php?page=ai-magic-settings3,3115.37105.5886.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/newsletter-page-redirects/public/partials/ai-magic-public-display.php
    • > /wp-content/plugins/newsletter-page-redirects/admin/partials/ai-magic-admin-display.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/newsletter-page-redirects/includes/class-ai-magic-vars.php:309
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/newsletter-page-redirects/admin/class-ai-magic-metabox.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/newsletter-page-redirects/admin/class-ai-magic-menu.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/newsletter-page-redirects/includes/class-ai-magic-logs.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% 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
Please fix the following attributes: The official readme.txt might help

newsletter-page-redirects/ai-magic.php 77% from 13 tests

The main PHP file in "AI Magic - SEO Content Generator & Article Writer" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("newsletter-page-redirects.php" instead of "ai-magic.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 299 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected34,852 lines of code in 158 files:
LanguageFilesBlank linesComment linesLines of code
PHP1358,33517,85934,326
JavaScript650140263
Markdown1680214
CSS154833
XML13016

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity79.28
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,293
▷ Static methods20015.47%
▷ Public methods89869.45%
▷ Protected methods171.31%
▷ Private methods37829.23%
Functions110
▷ Named functions110100.00%
▷ Anonymous functions00.00%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 2.10MB with 1.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png324.93KB83.70KB▼ 74.24%
assets/banner-772x250.png212.01KB44.58KB▼ 78.97%
wordpress-sdk-master/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/screenshot-4.png480.86KB152.86KB▼ 68.21%
assets/screenshot-5.png357.63KB97.64KB▼ 72.70%