68% question-answer

Code Review | Question Answer

WordPress plugin Question Answer scored68%from 54 tests.

About plugin

  • Plugin page: question-answer
  • Plugin version: 1.2.70
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 12, 2016
  • Latest release: Jul 3, 2023
  • Number of updates: 226
  • Update frequency: every 11.1 days
  • Top authors: pickplugins (88.05%)paratheme (12.39%)

Code review

54 tests

User reviews

13 reviews

Install metrics

700+ active /50,689 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲2.44MB] [CPU: ▲8.53ms] Passed 4 tests

This is a short check of server-side resources used by Question Answer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.82 ▲2.3647.79 ▲5.20
Dashboard /wp-admin5.82 ▲2.5257.82 ▲11.73
Posts /wp-admin/edit.php5.84 ▲2.4863.60 ▲17.85
Add New Post /wp-admin/post-new.php8.39 ▲2.5091.52 ▲1.71
Media Library /wp-admin/upload.php5.63 ▲2.4050.80 ▲15.46
Add Question /wp-admin/post-new.php?post_type=question5.9063.91
/wp-admin/index.php?page=qa-setup5.4140.52
Settings /wp-admin/edit.php?post_type=question&page=settings6.2459.20
All Answers /wp-admin/edit.php?post_type=answer5.7049.16
Question Tags /wp-admin/edit-tags.php?taxonomy=question_tags&post_type=question5.6548.75
All Keywords /wp-admin/edit.php?post_type=qa_keyword5.7052.37
Welcome /wp-admin/edit.php?post_type=question&page=qa_welcome5.6549.45
All Questions /wp-admin/edit.php?post_type=question5.7048.67
Questions Categories /wp-admin/edit-tags.php?taxonomy=question_cat&post_type=question5.6651.94

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 170 new files
Database: 2 new tables, 13 new options
New tables
wp_qa_follow
wp_qa_notification
New WordPress options
widget_qa_widget_top_questions
question_cat_children
widget_theysaidso_widget
widget_qa_widget_categories
widget_qa_widget_latest_questions
db_upgraded
widget_qa_widget_leaderboard
widget_qa_widget_tags
widget_recent-comments
can_compress_scripts
...

Browser metrics Passed 4 tests

Checking browser requirements for Question Answer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,124 ▲36715.58 ▲1.245.46 ▲3.6040.95 ▼4.85
Dashboard /wp-admin2,429 ▲2416.71 ▲0.81125.31 ▲17.2140.32 ▼4.55
Posts /wp-admin/edit.php2,341 ▲2523.59 ▲1.6252.51 ▲14.2932.93 ▼3.45
Add New Post /wp-admin/post-new.php1,590 ▲7023.05 ▼0.03657.80 ▼29.8436.03 ▼15.25
Media Library /wp-admin/upload.php1,480 ▲924.39 ▲0.1779.53 ▼34.4040.26 ▼7.70
Add Question /wp-admin/post-new.php?post_type=question3,0148.22198.3489.19
/wp-admin/index.php?page=qa-setup280.440.084.17
Settings /wp-admin/edit.php?post_type=question&page=settings9,37216.97492.1650.08
All Answers /wp-admin/edit.php?post_type=answer1,3623.6354.0934.83
Question Tags /wp-admin/edit-tags.php?taxonomy=question_tags&post_type=question1,4923.5043.7727.83
All Keywords /wp-admin/edit.php?post_type=qa_keyword1,3553.6444.3426.90
Welcome /wp-admin/edit.php?post_type=question&page=qa_welcome1,4493.3044.2546.83
All Questions /wp-admin/edit.php?post_type=question1,4093.6448.1831.66
Questions Categories /wp-admin/edit-tags.php?taxonomy=question_cat&post_type=question1,6183.3948.2130.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 2 tables
    • wp_qa_notification
    • wp_qa_follow
  • Zombie WordPress options were found after uninstall: 13 options
    • db_upgraded
    • widget_qa_widget_tags
    • widget_qa_widget_top_questions
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_qa_widget_website_stats
    • question_cat_children
    • widget_qa_widget_latest_questions
    • widget_qa_widget_leaderboard
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/question-answer/includes/functions-notification.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/question-answer/includes/functions-counter.php:257

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/index.php?page=qa-setup
    • > Network (severe)
    wp-admin/index.php?page=qa-setup - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=question&page=settings
    • > Network (severe)
    wp-admin/%7Bsite_logo_url%7D - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% 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 do not have images: #4 (Screenshot 4), #7 (Screenshot 7), #8 (Screenshot 8), #9 (Screenshot 9), #10 (Screenshot 10)
Please take inspiration from this readme.txt

question-answer/question-answer.php Passed 13 tests

The main PHP file in "Question Answer" ver. 1.2.70 adds more information about the plugin and also serves as the entry point for this plugin
54 characters long description:
Create Awesome Question and Answer Website in a Minute

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
Success! There were no dangerous files found in this plugin29,662 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
PHP867,24276112,661
SVG30128,882
CSS222,8592776,819
JavaScript109011391,300

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity28.29
▷ Minimum class complexity1.00
▷ Maximum class complexity641.00
Average method complexity7.13
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods150
▷ Static methods00.00%
▷ Public methods14999.33%
▷ Protected methods00.00%
▷ Private methods10.67%
Functions196
▷ Named functions19599.49%
▷ Anonymous functions10.51%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
29 PNG files occupy 0.33MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/front/css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
assets/front/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
assets/global/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
assets/front/images/thumb-large.png24.61KB3.33KB▼ 86.49%
assets/global/css/images/ui-icons_ffffff_256x240.png6.17KB4.18KB▼ 32.17%