10% bs-faq

Code Review | BS FAQ Plugin

WordPress plugin BS FAQ Plugin scored10%from 54 tests.

About plugin

  • Plugin page: bs-faq
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Feb 1, 2018
  • Latest release: Feb 4, 2018
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: bipulsarkar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /613 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/bs_faq_list.php+17
    Undefined index: show_editor_helper

Server metrics [RAM: ▼1.71MB] [CPU: ▼60.23ms] Passed 4 tests

A check of server-side resources used by BS FAQ Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.27 ▼1.198.72 ▼35.82
Dashboard /wp-admin2.30 ▼1.019.95 ▼45.42
Posts /wp-admin/edit.php2.30 ▼1.0610.49 ▼48.63
Add New Post /wp-admin/post-new.php2.30 ▼3.597.83 ▼110.06
Media Library /wp-admin/upload.php2.30 ▼0.938.34 ▼36.81
Info /wp-admin/edit.php?post_type=bs_faq&page=bsfaqinfo2.309.04
Add New /wp-admin/post-new.php?post_type=bs_faq2.308.36
Tags /wp-admin/edit-tags.php?taxonomy=bs_faq_tag&post_type=bs_faq2.309.99
Category /wp-admin/edit-tags.php?taxonomy=bs_faq_type&post_type=bs_faq2.309.35
Import /wp-admin/edit.php?post_type=bs_faq&page=bsfaqimport2.308.85
BS FAQ /wp-admin/edit.php?post_type=bs_faq2.307.69
Settings /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings2.308.94

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_bs_recent_faq
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

BS FAQ Plugin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲17413.34 ▼1.399.26 ▲7.5541.38 ▼6.07
Dashboard /wp-admin2,236 ▲565.57 ▼0.0892.79 ▼4.1477.25 ▲33.52
Posts /wp-admin/edit.php2,153 ▲501.95 ▼0.0634.50 ▼2.6237.37 ▲1.22
Add New Post /wp-admin/post-new.php1,572 ▲3523.28 ▲4.88641.16 ▼10.17149.62 ▲87.63
Media Library /wp-admin/upload.php1,450 ▲534.13 ▼0.0897.66 ▼3.0174.48 ▲29.26
Info /wp-admin/edit.php?post_type=bs_faq&page=bsfaqinfo8452.0024.0461.52
Add New /wp-admin/post-new.php?post_type=bs_faq2,7027.94192.00119.33
Tags /wp-admin/edit-tags.php?taxonomy=bs_faq_tag&post_type=bs_faq1,2962.1232.8735.27
Category /wp-admin/edit-tags.php?taxonomy=bs_faq_type&post_type=bs_faq1,3242.1226.5130.10
Import /wp-admin/edit.php?post_type=bs_faq&page=bsfaqimport8591.9922.8931.53
BS FAQ /wp-admin/edit.php?post_type=bs_faq1,1811.9434.5929.36
Settings /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings9632.1822.9731.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/bs_faq_list.php+17
    Undefined index: show_editor_helper
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_bs_recent_faq
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 33 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+150
    Undefined index: show_editor_helper
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+104
    Undefined index: hide_category
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+113
    Undefined index: hide_tags
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+122
    Undefined index: hide_date
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+131
    Undefined index: hide_name
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+178
    Undefined index: question_title_color
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+188
    Undefined index: question_title_back_color
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+198
    Undefined index: question_ans_color
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+208
    Undefined index: question_ans_back_color
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+218
    Undefined index: accordion_style
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+243
    Undefined index: faq_toggle
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Notice in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings.php+252
    Undefined index: numberOf_faq

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/tinymce_buttons2.php
    • > /wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/tinymce_buttons.php
    • > /wp-content/plugins/bs-faq/admin/partials/bs_faq_plugin-admin-display.php
    • > /wp-content/plugins/bs-faq/public/partials/bs_faq_plugin-public-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_view_count.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/bs_faq_settings_value.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/bs_faq_visual_editor1.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bs-faq/includes/bs_faq_file/bs_faq_settings_value.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bs-faq/includes/bs_faq_file/shortcode/bs_faq_visual_editor2.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings
    • > Rendering (warning) in unknown
    /wp-admin/edit.php?post_type=bs_faq&page=bsfaqsettings 151 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (FAQs), #2 (Add/Edit FAQ), #3 (FAQ Category), #4 (FAQs Info)
You can take inspiration from this readme.txt

bs-faq/bs_faq_plugin.php 85% from 13 tests

"BS FAQ Plugin" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bs-faq.php" instead of "bs_faq_plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,737 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP307366881,632
CSS3211186
JavaScript3165419

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.26
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods81
▷ Static methods22.47%
▷ Public methods7693.83%
▷ Protected methods00.00%
▷ Private methods56.17%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/bs_faq_file/bs_faq_icon.png1.15KB1.06KB▼ 8.29%