66% faq-for-woocommerce

Code Review | XPlainer - WooCommerce Product FAQ [WooCommerce Accordion FAQ Plugin]

WordPress plugin XPlainer - WooCommerce Product FAQ [WooCommerce Accordion FAQ Plugin] scored66%from 54 tests.

About plugin

  • Plugin page: faq-for-woocommerce
  • Plugin version: 1.5.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Oct 27, 2020
  • Latest release: Nov 18, 2023
  • Number of updates: 214
  • Update frequency: every 5.2 days
  • Top authors: wpfeelteam (90.19%)nayanchamp7 (10.28%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /26,471 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.88MB] [CPU: ▲8.47ms] Passed 4 tests

Server-side resources used by XPlainer - WooCommerce Product FAQ [WooCommerce Accordion FAQ Plugin]
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5443.40 ▲7.74
Dashboard /wp-admin4.30 ▲1.0052.00 ▲6.68
Posts /wp-admin/edit.php4.35 ▲1.0057.36 ▲14.33
Add New Post /wp-admin/post-new.php7.03 ▲1.1599.81 ▲9.46
Media Library /wp-admin/upload.php4.23 ▲1.0045.90 ▲10.01
Add New /wp-admin/post-new.php?post_type=ffw7.0391.21
Settings /wp-admin/edit.php?post_type=ffw&page=woocommerce-faq4.4141.03
All FAQS /wp-admin/edit.php?post_type=ffw4.3246.26
Upgrade /wp-admin/edit.php?post_type=ffw&page=ffw-upgrade-to-pro4.2537.35
FAQ Categories /wp-admin/edit-tags.php?taxonomy=ffw-category&post_type=ffw4.2241.26
FAQ Tags /wp-admin/edit-tags.php?taxonomy=ffw-tag&post_type=ffw4.2242.06
Dashboard /wp-admin/edit.php?post_type=ffw&page=ffw-dashboard4.3338.82

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 160 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
ffw_post_generation
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by XPlainer - WooCommerce Product FAQ [WooCommerce Accordion FAQ Plugin]
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲22313.42 ▼0.938.77 ▲6.9437.23 ▼2.90
Dashboard /wp-admin2,280 ▲1005.69 ▲0.0697.20 ▼3.6346.21 ▼0.40
Posts /wp-admin/edit.php2,191 ▲882.13 ▲0.1640.07 ▼0.7138.53 ▼0.04
Add New Post /wp-admin/post-new.php1,613 ▲8725.21 ▲2.30610.07 ▼2.9591.12 ▲39.21
Media Library /wp-admin/upload.php1,491 ▲884.22 ▲0.0997.22 ▼22.2947.20 ▼1.71
Add New /wp-admin/post-new.php?post_type=ffw6,36519.27903.8936.13
Settings /wp-admin/edit.php?post_type=ffw&page=woocommerce-faq4,0777.89175.32203.23
All FAQS /wp-admin/edit.php?post_type=ffw1,3112.0433.8338.78
Upgrade /wp-admin/edit.php?post_type=ffw&page=ffw-upgrade-to-pro8621.127.9724.70
FAQ Categories /wp-admin/edit-tags.php?taxonomy=ffw-category&post_type=ffw1,3652.2532.0639.47
FAQ Tags /wp-admin/edit-tags.php?taxonomy=ffw-tag&post_type=ffw1,3312.2627.9335.57
Dashboard /wp-admin/edit.php?post_type=ffw&page=ffw-dashboard2,06712.32258.0388.47

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • ffw_post_generation
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ffw&page=ffw-upgrade-to-pro
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/faq-for-woocommerce/views/ffw-dashboard.php
    • > /wp-content/plugins/faq-for-woocommerce/views/ffw-basic-template.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/faq-for-woocommerce/views/ffw-trip-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/faq-for-woocommerce/views/ffw-pop-template.php:2
    • > PHP Notice
      Undefined variable: faqs in wp-content/plugins/faq-for-woocommerce/views/ffw-basic-template.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/faq-for-woocommerce/views/ffw-classic-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/faq-for-woocommerce/views/dashboard/header.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/faq-for-woocommerce/includes/template-parts/sidebar.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/faq-for-woocommerce/views/faq-woocommerce-modal-form.php:9
    • > PHP Warning
      Use of undefined constant FFW_PLUGIN_URL - assumed 'FFW_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/faq-for-woocommerce/views/faq-woocommerce-modal-form.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/faq-for-woocommerce/includes/faq-woocommerce-public.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/faq-for-woocommerce/includes/ffw-helper.php:190

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=ffw&page=ffw-dashboard
    • > Other (warning) in unknown
    /wp-admin/edit.php?post_type=ffw&page=ffw-dashboard 222 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 67 tag instead of maximum 10
The official readme.txt might help

faq-for-woocommerce/faq-for-woocommerce.php 92% from 13 tests

"XPlainer - WooCommerce Product FAQ [WooCommerce Accordion FAQ Plugin]" version 1.5.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.6" instead of "4.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin17,522 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
SVG11266,055
PHP391,2451,8725,897
Sass1033612,509
CSS2021232,316
JavaScript13151111542
Markdown1660181
JSON20022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity29.68
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes15.26%
Methods250
▷ Static methods72.80%
▷ Public methods21084.00%
▷ Protected methods72.80%
▷ Private methods3313.20%
Functions56
▷ Named functions5496.43%
▷ Anonymous functions23.57%
Constants22
▷ Global constants22100.00%
▷ Class constants00.00%
▷ Public constants00.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
39 PNG files occupy 1.69MB with 0.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/icon300.png2.23KB1.24KB▼ 44.57%
assets/admin/images/help.png0.62KB0.41KB▼ 33.65%
assets/admin/images/Facebook.png0.41KB0.34KB▼ 17.45%
assets/admin/images/card.png9.23KB3.73KB▼ 59.59%
assets/admin/images/crown.png0.98KB0.98KB0.20%