68% auto-focus-keyword-for-seo

Code Review | Auto Focus Keyword for SEO

WordPress plugin Auto Focus Keyword for SEO scored68%from 54 tests.

About plugin

  • Plugin page: auto-focus-keywor...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: Oct 4, 2023
  • Latest release: Oct 21, 2023
  • Number of updates: 4
  • Update frequency: every 4.5 days
  • Top authors: pagup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /183 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.61MB] [CPU: ▼4.62ms] Passed 4 tests

This is a short check of server-side resources used by Auto Focus Keyword for SEO
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6138.47 ▼3.32
Dashboard /wp-admin3.92 ▲0.6255.50 ▲6.01
Posts /wp-admin/edit.php3.98 ▲0.6248.94 ▼2.89
Add New Post /wp-admin/post-new.php6.46 ▲0.5882.96 ▼18.29
Media Library /wp-admin/upload.php3.85 ▲0.6241.92 ▲7.31
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.0136.31

Server storage [IO: ▲3.52MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 219 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
afkw_auto-focus-keyword-for-seo
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
fs_accounts
fs_debug_mode
widget_recent-comments
fs_active_plugins

Browser metrics Passed 4 tests

An overview of browser requirements for Auto Focus Keyword for SEO
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.35 ▼0.081.76 ▼0.0233.08 ▼10.78
Dashboard /wp-admin2,229 ▲495.58 ▲0.0486.63 ▼7.7142.35 ▲1.52
Posts /wp-admin/edit.php2,141 ▲442.04 ▲0.0435.69 ▲0.4635.84 ▲2.29
Add New Post /wp-admin/post-new.php1,548 ▲2223.45 ▲0.27667.98 ▲50.6070.68 ▲23.76
Media Library /wp-admin/upload.php1,437 ▲374.27 ▲0.05109.81 ▲10.4152.13 ▲5.20
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0892.0725.2526.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/auto-focus-keyword-for-seo/vendor/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_recent-posts
    • fs_debug_mode
    • db_upgraded
    • can_compress_scripts
    • fs_active_plugins
    • widget_recent-comments
    • theysaidso_admin_options
    • afkw_auto-focus-keyword-for-seo
    • fs_accounts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Trait 'Pagup\\AutoFocusKeyword\\Traits\\Helpers' not found in wp-content/plugins/auto-focus-keyword-for-seo/admin/controllers/SettingsController.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\AutoFocusKeyword\\Controllers\\SettingsController' not found in wp-content/plugins/auto-focus-keyword-for-seo/admin/Settings.php:10
    • > PHP Fatal error
      Trait 'Pagup\\AutoFocusKeyword\\Traits\\Helpers' not found in wp-content/plugins/auto-focus-keyword-for-seo/admin/controllers/KeywordController.php on line 6
    • > PHP Fatal error
      Trait 'Pagup\\AutoFocusKeyword\\Traits\\Helpers' not found in wp-content/plugins/auto-focus-keyword-for-seo/admin/controllers/MetaboxController.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: php_vars is not defined" "ReferenceError: php_vars is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/auto-focus-keyword-for-seo/admin/assets/metabox.js?ver=1696412634:3:18)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: php_vars is not defined

Optimizations

Plugin configuration 96% from 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
5 plugin tags: focus keyword, rank math, yoast seo, meta tag keyword, search engines

auto-focus-keyword-for-seo/auto-focus-keyword-for-seo.php 92% from 13 tests

The principal PHP file in "Auto Focus Keyword for SEO" v. 1.0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

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 detected35,723 lines of code in 171 files:
LanguageFilesBlank linesComment linesLines of code
PHP1428,36217,54834,444
CSS174935671
JavaScript109989584
XML13016
JSON1008

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity75.52
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.49
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces0
Traits1
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,330
▷ Static methods22216.69%
▷ Public methods93870.53%
▷ Protected methods171.28%
▷ Private methods37528.20%
Functions109
▷ Named functions10293.58%
▷ Anonymous functions76.42%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/icon.png25.78KB4.21KB▼ 83.68%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%