72% cm-faq

Code Review | CM FAQ

WordPress plugin CM FAQ scored72%from 54 tests.

About plugin

  • Plugin page: cm-faq
  • Plugin version: 1.1.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 27, 2016
  • Latest release: Jul 23, 2023
  • Number of updates: 153
  • Update frequency: every 17.9 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /4,625 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.72MB] [CPU: ▲1.23ms] 75% from 4 tests

This is a short check of server-side resources used by CM FAQ
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 937.31ms on /wp-admin/admin.php?page=cm-faq-options)
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.7344.13 ▲3.27
Dashboard /wp-admin4.04 ▲0.7353.11 ▲0.56
Posts /wp-admin/edit.php4.09 ▲0.7354.80 ▲3.82
Add New Post /wp-admin/post-new.php6.65 ▲0.7791.38 ▼2.75
Media Library /wp-admin/upload.php3.89 ▲0.6740.32 ▲4.29
User Guide /wp-admin/admin.php?page=cmfaq_about4.06489.96
Questions /wp-admin/edit.php?post_type=cmfaq_question4.0046.76
Add New Question /wp-admin/post-new.php?post_type=cmfaq_question6.6492.86
Categories /wp-admin/edit-tags.php?taxonomy=cmfaq_category3.9848.79
Upgrade ➤ /wp-admin/admin.php?page=cmfaq_pro3.9139.61
Options /wp-admin/admin.php?page=cm-faq-options4.13937.31

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 71 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
cmfaq_page_id
theysaidso_admin_options
cmfaq_categories
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for CM FAQ
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲10313.22 ▼1.161.94 ▲0.2941.68 ▼2.61
Dashboard /wp-admin2,240 ▲494.93 ▲0.01107.22 ▼1.7481.86 ▲43.34
Posts /wp-admin/edit.php2,132 ▲432.00 ▼0.0036.77 ▼3.6240.95 ▲4.17
Add New Post /wp-admin/post-new.php1,552 ▲2223.26 ▲5.03716.11 ▲98.1455.46 ▲2.71
Media Library /wp-admin/upload.php1,425 ▲344.21 ▼0.0798.52 ▼7.6873.74 ▲29.87
User Guide /wp-admin/admin.php?page=cmfaq_about3,99915.71376.18223.11
Questions /wp-admin/edit.php?post_type=cmfaq_question1,1151.9831.9533.80
Add New Question /wp-admin/post-new.php?post_type=cmfaq_question6,22923.15889.0231.30
Categories /wp-admin/edit-tags.php?taxonomy=cmfaq_category1,4473.2541.0680.27
Upgrade ➤ /wp-admin/admin.php?page=cmfaq_pro1,7982.0736.6944.15
Options /wp-admin/admin.php?page=cm-faq-options2,5288.2474.3477.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • cmfaq_page_id
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • cmfaq_categories
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cm-faq/views/backend/nav.php
    • > /wp-content/plugins/cm-faq/views/backend/template.php
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-faq/package/views/plugin_compare_table.php:51
    • > PHP Fatal error
      Uncaught Error: Class 'CMFAQ_Frontend' not found in wp-content/plugins/cm-faq/views/frontend/taxonomy.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CMFAQ_Frontend' not found in wp-content/plugins/cm-faq/views/frontend/shortcode.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-faq/package/views/userguide_free.php:8
    • > PHP Notice
      Undefined variable: submenus in wp-content/plugins/cm-faq/views/backend/nav.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-faq/package/cminds-plugin-config.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMFAQ_Frontend' not found in wp-content/plugins/cm-faq/views/frontend/post-short.php:9
    • > PHP Notice
      Undefined variable: nav in wp-content/plugins/cm-faq/views/backend/template.php on line 3
    • > PHP Warning
      Use of undefined constant CMFAQ_NAME - assumed 'CMFAQ_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-faq/views/backend/template.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-faq/package/views/registration.php:42

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=cmfaq_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmfaq_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmfaq_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yq/r/EkaQjAsGGEY.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmfaq_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yq/r/EkaQjAsGGEY.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: knowledge base, faq, search widget, faq widget, frequently asked questions

cm-faq/cm-faq.php Passed 13 tests

This is the main PHP file of "CM FAQ" version 1.1.10, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
56 characters long description:
Build frequently answered question (FAQ) knowledge base.

Code Analysis Passed 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
There were no executable files found in this plugin6,118 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP198583285,216
CSS39832746
JavaScript647215156

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity74.60
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods147
▷ Static methods7148.30%
▷ Public methods13893.88%
▷ Protected methods85.44%
▷ Private methods10.68%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants10
▷ Global constants770.00%
▷ Class constants330.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
39 PNG files occupy 0.54MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/css/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
package/css/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
package/views/SEOHoundIcon.png33.38KB8.82KB▼ 73.58%
package/views/99suite.png14.06KB5.58KB▼ 60.33%
package/views/tooltip.png16.77KB6.28KB▼ 62.54%