10% wp-tincan

Code Review | WP-Tincan

WordPress plugin WP-Tincan scored 10% from 54 tests.

About plugin

  • Plugin page: wp-tincan
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-3.7.1
  • WordPress version: 6.3.1
  • First release: Dec 1, 2013
  • Latest release: Dec 1, 2013
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: sagedreaddesigns (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,985 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/wp-tincan/wp-tincan.php+647
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.64MB] [CPU: ▼50.20ms] Passed 4 tests

Server-side resources used by WP-Tincan
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.34 ▼1.126.98 ▼34.26
Dashboard /wp-admin2.36 ▼0.947.86 ▼37.27
Posts /wp-admin/edit.php2.36 ▼0.998.11 ▼45.09
Add New Post /wp-admin/post-new.php2.36 ▼3.527.89 ▼84.18
Media Library /wp-admin/upload.php2.36 ▼0.866.14 ▼26.76
Add New /wp-admin/post-new.php?post_type=quiz2.367.77
WP-Tincan /wp-admin/admin.php?page=tincanpage2.368.15
All Certificates /wp-admin/edit.php?post_type=certificate2.377.65
Add New /wp-admin/post-new.php?post_type=certificate2.366.65
TinCan Quiz Settings /wp-admin/admin.php?page=tincan-quiz-settings2.367.34
Courses /wp-admin/edit-tags.php?taxonomy=tincancourses&post_type=lesson2.376.74
TinCan LRS Settings /wp-admin/admin.php?page=tincan-lrs-settings2.3613.66
Add New /wp-admin/post-new.php?post_type=lesson2.366.95
Quizzes /wp-admin/edit-tags.php?taxonomy=quiz_categories&post_type=certificate2.378.66
All Lessons /wp-admin/edit.php?post_type=lesson2.376.77

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-Tincan
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,090 ▲34413.89 ▼0.507.08 ▲4.8743.68 ▲2.24
Dashboard /wp-admin2,322 ▲1315.08 ▼0.81117.01 ▲1.1989.90 ▲45.58
Posts /wp-admin/edit.php2,226 ▲1372.12 ▲0.0938.54 ▼3.0837.29 ▼1.04
Add New Post /wp-admin/post-new.php6,609 ▲5,09520.47 ▲3.01936.51 ▲304.1240.25 ▼12.44
Media Library /wp-admin/upload.php1,516 ▲1254.38 ▲0.11113.88 ▲6.9588.45 ▲41.59
Add New /wp-admin/post-new.php?post_type=quiz2,5037.84199.64159.70
WP-Tincan /wp-admin/admin.php?page=tincanpage9521.8732.6330.30
All Certificates /wp-admin/edit.php?post_type=certificate1,1902.0533.6029.53
Add New /wp-admin/post-new.php?post_type=certificate2,3657.78176.16142.11
TinCan Quiz Settings /wp-admin/admin.php?page=tincan-quiz-settings9551.8027.9527.87
Courses /wp-admin/edit-tags.php?taxonomy=tincancourses&post_type=lesson1,3902.2529.0029.39
TinCan LRS Settings /wp-admin/admin.php?page=tincan-lrs-settings9351.8725.1423.35
Add New /wp-admin/post-new.php?post_type=lesson2,7798.01180.84130.84
Quizzes /wp-admin/edit-tags.php?taxonomy=quiz_categories&post_type=certificate1,3962.2527.8929.39
All Lessons /wp-admin/edit.php?post_type=lesson1,2402.0635.7531.41

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-tincan/wp-tincan.php+647
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=lesson
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/wp-tincan/wp-tincan.php+647
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lesson
    • > Notice in wp-content/plugins/wp-tincan/wp-tincan.php+230
    Undefined index: question_box_nonce

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-tincan/template.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-tincan/wp-tincan.php:28

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)
Please fix the following browser errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=lesson
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-tincan/js/quiz.js?ver=6.3.1 17:15 Uncaught ReferenceError: quiz is not defined
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=lesson
    • > Network (severe)
    wp-content/plugins/tincan/icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-tincan === )
  • Contributors: Plugin contributors not specified
The official readme.txt might help

wp-tincan/wp-tincan.php 92% from 13 tests

Analyzing the main PHP file in "WP-Tincan" version 1.0
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 312 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected5,899 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript121,0132,2164,683
PHP2213871,011
CSS14011172
Markdown18033

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.19MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon.png0.57KB0.52KB▼ 8.81%
img/incorrect.png1.59KB1.49KB▼ 6.20%
img/quiz.png5.29KB3.94KB▼ 25.62%
img/correct.png1.65KB1.32KB▼ 19.89%
img/rhinoslider-sprite.png7.29KB3.27KB▼ 55.15%