57% wp-post-author

Code Review | WP Post Author - Enhance Your Posts with the Author Bio, Co-Authors, Guest Authors, and Post Rating System, including User Registration Form Builder

WordPress plugin WP Post Author - Enhance Your Posts with the Author Bio, Co-Authors, Guest Authors, and Post Rating System, including User Registration Form Builder scored57%from 54 tests.

About plugin

  • Plugin page: wp-post-author
  • Plugin version: 3.6.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 14, 2018
  • Latest release: Nov 23, 2023
  • Number of updates: 59
  • Update frequency: every 35.3 days
  • Top authors: afthemes (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

10,000+ active /529,722 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.69MB] [CPU: ▲44.70ms] 75% from 4 tests

This is a short check of server-side resources used by WP Post Author - Enhance Your Posts with the Author Bio, Co-Authors, Guest Authors, and Post Rating System, including User Registration Form Builder
Please fix the following
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.69MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.30 ▲5.8393.77 ▲53.48
Dashboard /wp-admin9.32 ▲6.01100.37 ▲42.05
Posts /wp-admin/edit.php9.32 ▲5.96108.67 ▲60.76
Add New Post /wp-admin/post-new.php10.85 ▲4.96125.54 ▲32.48
Media Library /wp-admin/upload.php9.32 ▲6.0982.68 ▲50.80
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius9.3274.10

Server storage [IO: ▲10.17MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 318 new files
Database: 3 new tables, 15 new options
New tables
wp_wpa_subscriptions
wp_wpa_guest_authors
wp_wpa_form_builder
New WordPress options
awpa_setting_options
awpa_upgrade_notice_start_time
theysaidso_admin_options
widget_wp__post_author_custom
widget_wp__post_author_specific
db_upgraded
widget_recent-comments
fs_accounts
widget_wp__post_author
awpa_seed_insert
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Post Author - Enhance Your Posts with the Author Bio, Co-Authors, Guest Authors, and Post Rating System, including User Registration Form Builder
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,164 ▲40224.43 ▲10.1941.78 ▲40.0629.80 ▼15.62
Dashboard /wp-admin2,350 ▲17911.80 ▲6.19272.43 ▲172.5546.05 ▲0.78
Posts /wp-admin/edit.php2,259 ▲15910.65 ▲8.7093.62 ▲53.3738.02 ▼1.19
Add New Post /wp-admin/post-new.php1,684 ▲15824.89 ▲1.61482.30 ▼188.5637.59 ▼12.40
Media Library /wp-admin/upload.php1,628 ▲22812.46 ▲8.29139.51 ▲41.8443.52 ▲1.04
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,19010.2886.9228.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wp-post-author/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_wpa_guest_authors
    • wp_wpa_form_builder
    • wp_wpa_subscriptions
  • This plugin did not uninstall successfully, leaving 15 options in the database
    • db_upgraded
    • fs_active_plugins
    • widget_recent-comments
    • widget_wp__post_author_specific
    • can_compress_scripts
    • awpa_upgrade_notice_start_time
    • fs_debug_mode
    • widget_theysaidso_widget
    • awpa_setting_options
    • widget_recent-posts
    • ...

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-post-author/includes/multi-authors/wpa-multi-authors.php
    • > /wp-content/plugins/wp-post-author/includes/admin/awpa-form-menu.php
    • > /wp-content/plugins/wp-post-author/aft-wp-post-author.php
    • > /wp-content/plugins/wp-post-author/includes/rating/awpa-rating.php
    • > /wp-content/plugins/wp-post-author/includes/init.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AWPA_Widget_Base' not found in wp-content/plugins/wp-post-author/includes/awpa-widget-specific.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-post-author/includes/awpa-widget-base.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-author/includes/themes/multi-authors-list.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-author/includes/database/create-db.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-author/includes/admin/awpa-form-meta.php:32
    • > PHP Fatal error
      Uncaught Error: Call to a member function insert() on null in wp-content/plugins/wp-post-author/includes/database/seeder-db.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'AWPA_Widget_Base' not found in wp-content/plugins/wp-post-author/includes/awpa-widget.php:6
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-post-author/includes/database/seeder-db.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-post-author/includes/top-rated-post.php:84
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-author/includes/awpa-user-login.php:50

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

wp-post-author/aft-wp-post-author.php 92% from 13 tests

This is the main PHP file of "WP Post Author - Enhance Your Posts with the Author Bio, Co-Authors, Guest Authors, and Post Rating System, including User Registration Form Builder" version 3.6.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-post-author.php" instead of "aft-wp-post-author.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin56,453 lines of code in 216 files:
LanguageFilesBlank linesComment linesLines of code
PHP1508,84517,68137,678
CSS386,64843716,452
JavaScript221455631,569
JSON200503
Markdown1680214
SVG20021
XML13016

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following 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.60
Average class complexity72.81
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes68
▷ Abstract classes22.94%
▷ Concrete classes6697.06%
▷ Final classes00.00%
Methods1,407
▷ Static methods19914.14%
▷ Public methods1,01372.00%
▷ Protected methods171.21%
▷ Private methods37726.79%
Functions160
▷ Named functions15798.12%
▷ Anonymous functions31.88%
Constants152
▷ Global constants10367.76%
▷ Class constants4932.24%
▷ Public constants49100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wp-post-author.png22.52KB9.35KB▼ 58.47%
assets/dist/images/awpa-header-layout-3.png0.62KB0.21KB▼ 66.25%
freemius/assets/img/wp-post-author-pro.png9.16KB5.26KB▼ 42.58%
assets/dist/images/wp-author_layout-2.png0.85KB0.33KB▼ 61.28%
assets/dist/images/awpa-header-layout-7.png0.82KB0.47KB▼ 42.36%