73% mos-testimonial

Code Review | Mos Testimonial

WordPress plugin Mos Testimonial scored73%from 54 tests.

About plugin

  • Plugin page: mos-testimonial
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.0
  • WordPress version: 6.3.1
  • First release: Mar 29, 2019
  • Latest release: Jan 23, 2020
  • Number of updates: 8
  • Update frequency: every 38.6 days
  • Top authors: mostak.shahid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /615 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.39MB] [CPU: ▼17.76ms] Passed 4 tests

Server-side resources used by Mos Testimonial
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4130.51 ▼12.51
Dashboard /wp-admin3.75 ▲0.4433.68 ▼15.61
Posts /wp-admin/edit.php3.88 ▲0.5337.69 ▼16.41
Add New Post /wp-admin/post-new.php6.06 ▲0.1889.34 ▼26.51
Media Library /wp-admin/upload.php3.77 ▲0.5440.93 ▲2.48
Add New /wp-admin/post-new.php?post_type=testimonial3.9247.38
Settings /wp-admin/edit.php?post_type=testimonial&page=mos_testimonial_settings3.8139.94
Tags /wp-admin/edit-tags.php?taxonomy=tag&post_type=testimonial3.7538.82
Categories /wp-admin/edit-tags.php?taxonomy=testimonial-category&post_type=testimonial3.7532.71
All Testimonials /wp-admin/edit.php?post_type=testimonial3.8633.77

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 953 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
recovery_mode_email_last_sent
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Mos Testimonial
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲17213.66 ▼0.295.35 ▲3.3439.07 ▼7.36
Dashboard /wp-admin2,279 ▲765.10 ▼0.91103.87 ▼15.5044.47 ▲3.77
Posts /wp-admin/edit.php2,134 ▲342.08 ▲0.0838.62 ▼2.2636.79 ▼5.53
Add New Post /wp-admin/post-new.php1,570 ▲2522.99 ▲0.01628.87 ▼24.2562.30 ▲5.39
Media Library /wp-admin/upload.php1,452 ▲524.33 ▲0.09116.09 ▼11.3352.02 ▲0.54
Add New /wp-admin/post-new.php?post_type=testimonial1,6521.5412.1748.67
Settings /wp-admin/edit.php?post_type=testimonial&page=mos_testimonial_settings1,6552.5846.4244.52
Tags /wp-admin/edit-tags.php?taxonomy=tag&post_type=testimonial1,3032.2229.4328.34
Categories /wp-admin/edit-tags.php?taxonomy=testimonial-category&post_type=testimonial1,3312.2228.5831.38
All Testimonials /wp-admin/edit.php?post_type=testimonial1,2072.2837.6529.69

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=testimonial
    • > Notice in wp-content/plugins/mos-testimonial/mos-testimonial-functions.php+3
    Undefined index: page
    • > GET request to /wp-admin/post-new.php?post_type=testimonial
    • > Compile error in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_File.php+15
    Declaration of CMB2_Type_File::render() must be compatible with CMB2_Type_Text::render($args = Array)
    • > GET request to /wp-admin/edit.php?post_type=testimonial&page=mos_testimonial_settings
    • > Notice in wp-content/plugins/mos-testimonial/mos-testimonial-settings.php+467
    Undefined index: tab
    • > GET request to /wp-admin/edit.php?post_type=testimonial&page=mos_testimonial_settings
    • > Notice in wp-content/plugins/mos-testimonial/mos-testimonial-settings.php+468
    Undefined index: testimonial_active_tab

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 40× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-testimonial/mos-testimonial-post-types.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Title.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mos-testimonial/mos-testimonial-metaboxes.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/mos-testimonial/plugins/metabox/includes/types/CMB2_Type_Textarea_Code.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=testimonial
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).sortable is not a function" "TypeError: $(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/mos-testimonial/js/mos-testimonial-admin.js?ver=6.3.1:21:29)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=testimonial
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: testimonial, wordpress testimonial, simple testimonial, testimonials, testimonial plugin...

mos-testimonial/mos-testimonial.php Passed 13 tests

The main PHP file in "Mos Testimonial" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
21 characters long description:
Base of future plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin142,224 lines of code in 788 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3138,3387,06970,124
PO File12013,78217,88231,544
HTML1823,8351123,000
CSS911,6081,4637,841
PHP561,8554,7946,878
Markdown876501,503
Sass14265251,258
JSON10047
SVG10019
Bourne Shell1015
YAML1005

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity17.05
▷ Minimum class complexity1.00
▷ Maximum class complexity146.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes812.70%
▷ Concrete classes5587.30%
▷ Final classes00.00%
Methods442
▷ Static methods6715.16%
▷ Public methods36883.26%
▷ Protected methods7116.06%
▷ Private methods30.68%
Functions58
▷ Named functions58100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants545.45%
▷ Class constants654.55%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
17 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugins/metabox/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
plugins/metabox/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
plugins/metabox/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
plugins/CodeMirror/doc/yinyang.png4.52KB2.03KB▼ 55.19%
plugins/metabox/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%