73% qbot-question-answer

Code Review | QBOT - Question Answer

WordPress plugin QBOT - Question Answer scored73%from 54 tests.

About plugin

  • Plugin page: qbot-question-answer
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.3.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2016
  • Latest release: Feb 3, 2016
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: inderjit.singh (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,152 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.85MB] [CPU: ▲3.80ms] Passed 4 tests

Analyzing server-side resources used by QBOT - Question Answer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.32 ▲2.8558.35 ▲19.84
Dashboard /wp-admin6.34 ▲3.0357.15 ▲7.37
Posts /wp-admin/edit.php6.34 ▲2.9847.37 ▼1.23
Add New Post /wp-admin/post-new.php8.40 ▲2.5191.75 ▼6.51
Media Library /wp-admin/upload.php6.34 ▲3.1152.38 ▲15.55
Admin Dashboard /wp-admin/admin.php?page=qbot-plugin6.3452.63
Manage Answers /wp-admin/edit.php?post_type=qbot-answer6.3447.76
Settings /wp-admin/admin.php?page=qbot-plugin-settings6.3448.94
Manage Questions /wp-admin/edit.php?post_type=qbot-question6.3450.42

Server storage [IO: ▲5.17MB] [DB: ▲1.79MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 488 new files
Database: 7 new tables, 28 new options
New tables
mcl_qbot_views
mcl_qbot_favorite_questions
mcl_qbot_votes
mcl_ip2location_db1
mcl_qbot_spam
mcl_qbot_roles
mcl_qbot_users
New WordPress options
qbot_notify_user
qbot_font_size
qbot_permalink_question
qbot_google_app_secret
qbot_font
qbot_google_app_id
widget_theysaidso_widget
qbot_font_bold
qbot_notification_new_question
qbot_disble_negative_rating
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for QBOT - Question Answer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7914.28 ▼0.381.71 ▼0.0543.04 ▲0.33
Dashboard /wp-admin2,223 ▲495.56 ▲0.0485.93 ▼2.7967.52 ▲28.87
Posts /wp-admin/edit.php2,137 ▲372.00 ▼0.0334.80 ▲0.3235.71 ▼0.24
Add New Post /wp-admin/post-new.php1,712 ▲18422.11 ▼1.04727.77 ▲40.3658.57 ▼1.12
Media Library /wp-admin/upload.php1,437 ▲374.25 ▼0.04104.82 ▲0.8468.36 ▲22.80
Admin Dashboard /wp-admin/admin.php?page=qbot-plugin1,1931.9824.1240.81
Manage Answers /wp-admin/edit.php?post_type=qbot-answer1,0951.9030.6829.59
Settings /wp-admin/admin.php?page=qbot-plugin-settings9691.8625.9327.58
Manage Questions /wp-admin/edit.php?post_type=qbot-question1,1371.9331.7732.10

Uninstaller [IO: ▲0.00MB] [DB: ▲1.79MB] 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
  • Zombie tables were found after uninstall: 7 tables
    • mcl_qbot_favorite_questions
    • mcl_qbot_roles
    • mcl_ip2location_db1
    • mcl_qbot_votes
    • mcl_qbot_spam
    • mcl_qbot_users
    • mcl_qbot_views
  • Zombie WordPress options were found after uninstall: 28 options
    • theysaidso_admin_options
    • qbot_facebook_app_secret
    • qbot_line_height_size
    • qbot_permalink_question
    • qbot_notification_new_answer
    • db_upgraded
    • qbot_font_bold
    • qbot_question_style
    • widget_recent-comments
    • qbot_font_italic
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 75× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Signer' not found in wp-content/plugins/qbot-question-answer/includes/social/google/src/auth/Google_P12Signer.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/qbot-question-answer/includes/social/google/src/contrib/Google_TranslateService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/qbot-question-answer/includes/social/google/src/contrib/Google_Oauth2Service.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/qbot-question-answer/includes/social/google/src/contrib/Google_BloggerService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/qbot-question-answer/includes/social/google/src/contrib/Google_ComputeService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'qbotSettings' not found in wp-content/plugins/qbot-question-answer/includes/class-qbot-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/qbot-question-answer/includes/social/google/src/contrib/Google_FusiontablesService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'qbotSettings' not found in wp-content/plugins/qbot-question-answer/includes/class-qbot-admin-questions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/qbot-question-answer/views/admin_settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/qbot-question-answer/views/admin_answers.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

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
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #7 (Frontend customization with font, color & backgrounds.), #8 (Admin and user notifications custom template, wile new question or answer posted.), #9 (Shortcodes to integrate sidebar & widgets.), #10 (User stat & download all user in CSV format.)
The official readme.txt might help

qbot-question-answer/qbot.php 85% from 13 tests

The primary PHP file in "QBOT - Question Answer" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("qbot-question-answer.php" instead of "qbot.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin105,182 lines of code in 123 files:
LanguageFilesBlank linesComment linesLines of code
PHP822,2308,15998,361
CSS7466362,970
Sass1326241,352
LESS1326331,343
JavaScript62219583
SVG100565
SQL1008

PHP code Passed 2 tests

A brief analysis 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.09
Average class complexity2.22
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity1.15
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes770
▷ Abstract classes40.52%
▷ Concrete classes76699.48%
▷ Final classes00.00%
Methods6,399
▷ Static methods180.28%
▷ Public methods6,35999.37%
▷ Protected methods170.27%
▷ Private methods230.36%
Functions39
▷ Named functions3897.44%
▷ Anonymous functions12.56%
Constants22
▷ Global constants731.82%
▷ Class constants1568.18%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
346 compressed PNG files occupy 0.59MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flags/va.png0.54KB0.67KB0.00%
images/flags/europeanunion.png0.47KB0.66KB0.00%
images/flags/mk.png0.65KB0.74KB0.00%
images/flags/il.png0.42KB0.50KB0.00%
images/flags/tv.png0.52KB0.66KB0.00%