84% tp-education

Code Review | TP Education

WordPress plugin TP Education scored84%from 54 tests.

About plugin

  • Plugin page: tp-education
  • Plugin version: 4.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Oct 28, 2016
  • Latest release: Apr 27, 2023
  • Number of updates: 121
  • Update frequency: every 19.6 days
  • Top authors: themepalace (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /49,310 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.21MB] [CPU: ▼0.68ms] Passed 4 tests

This is a short check of server-side resources used by TP Education
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.65 ▲1.1945.77 ▲0.21
Dashboard /wp-admin4.52 ▲1.2256.02 ▲4.41
Posts /wp-admin/edit.php4.57 ▲1.2259.36 ▲8.12
Add New Post /wp-admin/post-new.php7.13 ▲1.24103.96 ▼15.46
Media Library /wp-admin/upload.php4.44 ▲1.2145.82 ▲12.80
All Testimonials /wp-admin/edit.php?post_type=tp-testimonial4.4945.12
Add New /wp-admin/post-new.php?post_type=tp-class4.6066.35
All Events /wp-admin/edit.php?post_type=tp-event4.4947.82
Add New /wp-admin/post-new.php?post_type=tp-excursion4.6064.46
Team Category /wp-admin/edit-tags.php?taxonomy=tp-team-category&post_type=tp-team4.4442.64
Event Tag /wp-admin/edit-tags.php?taxonomy=tp-event-tag&post_type=tp-event4.4450.22
Excursion Tag /wp-admin/edit-tags.php?taxonomy=tp-excursion-tag&post_type=tp-excursion4.4443.38
All Team /wp-admin/edit.php?post_type=tp-team4.4945.00
TP Education Settings /wp-admin/options-general.php?page=tp-education-admin4.3540.66
Event Category /wp-admin/edit-tags.php?taxonomy=tp-event-category&post_type=tp-event4.4442.12

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 83 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_widget_tp_featured_course_widget
widget_theysaidso_widget
widget_widget_tp_top_affiliation_widget
widget_recent-posts
tp_education_setting_option
widget_tp_education_team_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for TP Education
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,157 ▲39613.58 ▼0.7710.66 ▲8.7437.30 ▼9.40
Dashboard /wp-admin2,438 ▲2615.69 ▼0.0491.55 ▲3.2141.30 ▼3.19
Posts /wp-admin/edit.php2,343 ▲2431.98 ▼0.0541.57 ▲0.8036.01 ▲2.79
Add New Post /wp-admin/post-new.php1,748 ▲22223.17 ▲0.16665.34 ▼21.4856.37 ▲2.63
Media Library /wp-admin/upload.php1,643 ▲2464.25 ▲0.0893.80 ▼37.7444.22 ▲0.09
All Testimonials /wp-admin/edit.php?post_type=tp-testimonial1,3551.9331.4831.00
Add New /wp-admin/post-new.php?post_type=tp-class3,0437.94180.2471.40
All Events /wp-admin/edit.php?post_type=tp-event1,3661.9732.1732.68
Add New /wp-admin/post-new.php?post_type=tp-excursion2,9958.18174.5265.14
Team Category /wp-admin/edit-tags.php?taxonomy=tp-team-category&post_type=tp-team1,5142.1428.2530.49
Event Tag /wp-admin/edit-tags.php?taxonomy=tp-event-tag&post_type=tp-event1,4892.2730.6536.16
Excursion Tag /wp-admin/edit-tags.php?taxonomy=tp-excursion-tag&post_type=tp-excursion1,4892.2626.1431.78
All Team /wp-admin/edit.php?post_type=tp-team1,3661.9634.2632.07
TP Education Settings /wp-admin/options-general.php?page=tp-education-admin1,0831.7025.6029.48
Event Category /wp-admin/edit-tags.php?taxonomy=tp-event-category&post_type=tp-event1,5202.1727.0329.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_widget_tp_top_affiliation_widget
    • widget_tp_education_team_widget
    • widget_theysaidso_widget
    • tp_education_setting_option
    • widget_widget_tp_featured_course_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 26× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-education/template-parts/tp-search-tab-class-form.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-education/template-parts/tp-search-tab-excursion-form.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-education/template-parts/tp-content-single.php:222
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tp-education/templates/tp-archive-affiliation.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tp-education/templates/tp-archive-search.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-education/template-parts/tp-content-class.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-education/template-parts/tp-search-tab-event-form.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tp-education/templates/tp-archive-course.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tp-education/template-parts/tp-content-excursion.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tp-education/templates/tp-archive-excursion.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: custom post type, meta data, education

tp-education/tp-education.php 92% from 13 tests

The main PHP file in "TP Education" ver. 4.5 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 207 characters long)

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
No dangerous file extensions were detected9,792 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
PHP528481,2704,671
CSS10414384,118
JavaScript8226691,003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.12
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes14.17%
Methods114
▷ Static methods10.88%
▷ Public methods11298.25%
▷ Protected methods00.00%
▷ Private methods21.75%
Functions78
▷ Named functions78100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
7 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_555555_256x240.png3.53KB3.53KB0.03%
assets/css/images/ui-icons_cc0000_256x240.png3.19KB3.49KB0.00%
assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%
assets/css/images/ui-icons_ffffff_256x240.png3.19KB3.49KB0.00%
assets/css/images/ui-icons_444444_256x240.png3.52KB3.52KB0.06%