78% mos-faqs

Code Review | Mos FAQs

WordPress plugin Mos FAQs scored78%from 54 tests.

About plugin

  • Plugin page: mos-faqs
  • Plugin version: 2.0.3
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2018
  • Latest release: Nov 12, 2022
  • Number of updates: 30
  • Update frequency: every 47.3 days
  • Top authors: mostak.shahid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,046 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼6.68ms] Passed 4 tests

An overview of server-side resources used by Mos FAQs
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4840.47 ▼8.66
Dashboard /wp-admin3.77 ▲0.4750.28 ▼0.10
Posts /wp-admin/edit.php3.89 ▲0.5350.74 ▲3.00
Add New Post /wp-admin/post-new.php6.35 ▲0.4789.19 ▼20.95
Media Library /wp-admin/upload.php3.69 ▲0.4743.33 ▲6.20
Tags /wp-admin/edit-tags.php?taxonomy=faq-tag&post_type=qa3.6936.67
All FAQs /wp-admin/edit.php?post_type=qa3.7440.83
Categories /wp-admin/edit-tags.php?taxonomy=faq-category&post_type=qa3.6937.77
Settings /wp-admin/edit.php?post_type=qa&page=faq_settings3.6737.32
Add New /wp-admin/post-new.php?post_type=qa3.9059.49

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 422 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_mos-faqs-widget-default

Browser metrics Passed 4 tests

An overview of browser requirements for Mos FAQs
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲21013.97 ▼0.609.26 ▲7.5339.96 ▼3.09
Dashboard /wp-admin2,245 ▲575.88 ▲0.04105.32 ▲1.7442.02 ▼4.10
Posts /wp-admin/edit.php2,128 ▲392.00 ▼0.0135.38 ▼0.2735.88 ▼1.16
Add New Post /wp-admin/post-new.php1,570 ▲5622.99 ▲5.41689.00 ▲2.0052.87 ▼1.39
Media Library /wp-admin/upload.php1,427 ▲424.22 ▲0.0494.95 ▼7.5845.08 ▼0.54
Tags /wp-admin/edit-tags.php?taxonomy=faq-tag&post_type=qa1,2702.1428.5628.25
All FAQs /wp-admin/edit.php?post_type=qa1,2032.3334.9533.48
Categories /wp-admin/edit-tags.php?taxonomy=faq-category&post_type=qa1,3012.1428.0627.64
Settings /wp-admin/edit.php?post_type=qa&page=faq_settings4,0923.0776.9158.57
Add New /wp-admin/post-new.php?post_type=qa2,7877.88181.7575.27

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_mos-faqs-widget-default
    • db_upgraded

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 no errors were found, this is by no means an exhaustive test

SRP 0% 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 items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mos-faqs/plugins/index.php
    • > /wp-content/plugins/mos-faqs/css/index.php
    • > /wp-content/plugins/mos-faqs/js/index.php
    • > /wp-content/plugins/mos-faqs/fonts/index.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-settings-old.php:234
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-functions.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-vc-element.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-widgets.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-taxonomy.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-settings.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-faqs/mos-faq-post-types.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

mos-faqs/mos-faq.php 92% from 13 tests

The primary PHP file in "Mos FAQs" version 2.0.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("mos-faqs.php" instead of "mos-faq.php")

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 plugin72,244 lines of code in 409 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2216,0074,11945,682
HTML1302,5623114,038
CSS19135573,606
PHP1098662,721
SVG1002,671
Sass1434341,768
LESS1434441,758

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions48
▷ Named functions48100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugins/colorpicker/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
images/mos-vc.png3.73KB1.09KB▼ 70.79%