78% wp-faq-by-wpdonehere

Code Review | WP-FAQ

WordPress plugin WP-FAQ scored 78% from 54 tests.

About plugin

  • Plugin page: wp-faq-by-wpdonehere
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4.2
  • WordPress version: 6.3.1
  • First release: Dec 6, 2012
  • Latest release: Dec 6, 2012
  • Number of updates: 2
  • Update frequency: every 7.0 days
  • Top authors: Andrew Anderson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 5,172 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.10MB] [CPU: ▼4.22ms] Passed 4 tests

Server-side resources used by WP-FAQ
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.84 ▲2.03
Dashboard /wp-admin3.35 ▲0.0546.94 ▼0.96
Posts /wp-admin/edit.php3.40 ▲0.0447.75 ▼0.60
Add New Post /wp-admin/post-new.php5.34 ▼0.5479.31 ▼17.35
Media Library /wp-admin/upload.php3.27 ▲0.0437.52 ▲4.01
FAQ /wp-admin/edit.php?post_type=faq3.3237.08
FAQ Groups /wp-admin/edit-tags.php?taxonomy=faq_groups&post_type=faq3.2739.38
New entry /wp-admin/post-new.php?post_type=faq3.4050.02

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP-FAQ
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲7913.58 ▲0.304.38 ▲0.0843.12 ▲5.82
Dashboard /wp-admin2,249 ▲434.86 ▼1.0098.77 ▲1.5479.43 ▲39.14
Posts /wp-admin/edit.php2,153 ▲642.08 ▲0.0840.01 ▼0.3035.16 ▲0.25
Add New Post /wp-admin/post-new.php1,706 ▲16422.20 ▲3.93760.76 ▲162.4630.58 ▼23.28
Media Library /wp-admin/upload.php1,431 ▲404.25 ▲0.08112.99 ▲12.9046.26 ▲2.16
FAQ /wp-admin/edit.php?post_type=faq1,1162.0235.9733.38
FAQ Groups /wp-admin/edit-tags.php?taxonomy=faq_groups&post_type=faq1,3192.2227.8730.80
New entry /wp-admin/post-new.php?post_type=faq2,3347.87170.77143.25

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-faq-by-wpdonehere/index.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-faq-by-wpdonehere/index.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-faq-by-wpdonehere/classes/class-faq.php:267
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLBuilder' not found in wp-content/plugins/wp-faq-by-wpdonehere/classes/class-shortcode.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-faq-by-wpdonehere/classes/class-tinymce.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-faq-by-wpdonehere/classes/class-screen_meta.php:50

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)
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=faq
    • > 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: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-faq-by-wpdonehere/js/backend.js?ver=6.3.1:3:32)\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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=faq
    • > 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 TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: Plugin contributors field is missing
The official readme.txt is a good inspiration

wp-faq-by-wpdonehere/index.php 92% from 13 tests

Analyzing the main PHP file in "WP-FAQ" version 1.01
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-faq-by-wpdonehere.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin793 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP67692374
CSS37834245
JavaScript4242174

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.00
▷ Minimum class complexity4.00
▷ Maximum class complexity14.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2796.43%
▷ Protected methods00.00%
▷ Private methods13.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo.png7.94KB2.79KB▼ 64.82%
images/menu-icon.png3.82KB1.46KB▼ 61.72%
images/styles/picker-buttons.png7.40KB3.84KB▼ 48.10%
images/styles/purple.png9.58KB4.24KB▼ 55.79%
images/styles/white.png8.37KB3.69KB▼ 55.89%