72% studypress

Code Review | StudyPress

WordPress plugin StudyPress scored 72% from 54 tests.

About plugin

  • Plugin page: studypress
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-4.4.2
  • WordPress version: 5.8.1
  • First release: May 23, 2013
  • Latest release: Feb 7, 2016
  • Number of updates: 45
  • Update frequency: every 22.0 days
  • Top authors: mtadlaoui (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

90+ active / 17,221 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼121.10ms] Passed 4 tests

Server-side resources used by StudyPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2535.73 ▲11.32
Dashboard /wp-admin3.32 ▲0.2779.06 ▲7.92
Posts /wp-admin/edit.php3.37 ▲0.2576.28 ▲16.81
Add New Post /wp-admin/post-new.php5.62 ▲0.18127.28 ▼520.45
Media Library /wp-admin/upload.php3.20 ▲0.2062.66 ▲25.62
Parameters /wp-admin/admin.php?page=sp_parameters3.3082.15
Modifier Leçon /wp-admin/admin.php?page=mod-lesson3.3766.08
Modifier Cours /wp-admin/admin.php?page=mod-course3.3366.34
Modifier Quiz /wp-admin/admin.php?page=mod-quiz3.4566.16
Quizs /wp-admin/admin.php?page=quizs3.4464.76
Courses /wp-admin/admin.php?page=courses3.3163.20
Result Quiz /wp-admin/admin.php?page=result-quiz3.3061.41
Lessons /wp-admin/admin.php?page=id_Cours3.3964.55
Help /wp-admin/admin.php?page=sp_help3.2055.12

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 179 new files
Database: 14 new tables, no new options
New tables
wp_studypress_rate_quality
wp_studypress_course_category
wp_studypress_propositions
wp_studypress_gcourse
wp_studypress_course
wp_studypress_slide
wp_studypress_rate_domain
wp_studypress_domain
wp_studypress_questions
wp_studypress_quiz_result
...

Browser metrics Passed 4 tests

An overview of browser requirements for StudyPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,737 ▲10016.08 ▲0.527.36 ▼2.3350.93 ▼2.27
Dashboard /wp-admin3,021 ▲906.23 ▲0.29146.81 ▼39.73137.91 ▲3.68
Posts /wp-admin/edit.php2,782 ▲462.66 ▼0.0372.44 ▼6.5499.84 ▲10.32
Add New Post /wp-admin/post-new.php1,721 ▲12718.77 ▼0.09367.20 ▼19.30115.12 ▲2.02
Media Library /wp-admin/upload.php1,880 ▲735.16 ▲0.14142.49 ▼18.88145.39 ▲24.26
Parameters /wp-admin/admin.php?page=sp_parameters1,8942.6159.58127.34
Modifier Leçon /wp-admin/admin.php?page=mod-lesson1,3143.4471.7588.58
Modifier Cours /wp-admin/admin.php?page=mod-course1,3143.4473.0182.39
Modifier Quiz /wp-admin/admin.php?page=mod-quiz1,3173.3872.2594.57
Quizs /wp-admin/admin.php?page=quizs1,7623.5779.68159.17
Courses /wp-admin/admin.php?page=courses1,7613.6578.62135.84
Result Quiz /wp-admin/admin.php?page=result-quiz1,3862.4259.74107.71
Lessons /wp-admin/admin.php?page=id_Cours1,7823.5875.36151.71
Help /wp-admin/admin.php?page=sp_help1,7842.3955.48130.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 14 tables in the database
    • wp_studypress_gcourse
    • wp_studypress_quiz_result
    • wp_studypress_course
    • wp_studypress_slide
    • wp_studypress_propositions
    • wp_studypress_rate_quality
    • wp_studypress_activity
    • wp_studypress_domain
    • wp_studypress_visite
    • wp_studypress_configuration
    • ...

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
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=result-quiz
    • > Notice in wp-content/plugins/studypress/Views/admin/resultQuiz.view.php+172
    Undefined index: id

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/studypress/controllers/ratingQuality.controller.php
    • > /wp-content/plugins/studypress/controllers/ratingDomain.controller.php
  • 46× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractActivityManager' not found in wp-content/plugins/studypress/Class/QuizManager.class.php:3
    • > PHP Warning
      Use of undefined constant __ROOT_PLUGIN__ - assumed '__ROOT_PLUGIN__' (this will throw an Error in a future version of PHP) in wp-content/plugins/studypress/Views/admin/lesson.view.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to a member function isLoggedIn() on null in wp-content/plugins/studypress/Views/inc/js/rateSystem.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'StudyPressUserWP' not found in wp-content/plugins/studypress/notices.php:10
    • > PHP Fatal error
      require_once(): Failed opening required '__ROOT_PLUGIN__Views/includeCSS.php' (include_path='.:/usr/share/php') in wp-content/plugins/studypress/Views/admin/lesson.view.php on line 5
    • > PHP Warning
      require_once(__ROOT_PLUGIN__Views/includeCSS.php): failed to open stream: No such file or directory in wp-content/plugins/studypress/Views/admin/configuration.view.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function _e() on null in wp-content/plugins/studypress/Views/model/quiz/multiple.php:16
    • > PHP Notice
      Undefined variable: tr in wp-content/plugins/studypress/Views/admin/domain.view.php on line 1
    • > PHP Notice
      Undefined variable: tr in wp-content/plugins/studypress/Views/model/quiz/multiple.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractActivity' not found in wp-content/plugins/studypress/Class/Quiz.class.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 27 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (Course home page contaning lessons and quizzes), #2 (Lesson first page (here in full screen. It can be integrated in posts and pages)), #3 (Lesson with a multimedia slide), #4 (Lesson with a video integration), #5 (Quiz first page (here in full screen. It can be integrated in posts and pages)), #6 (Multiple choices question), #7 (Quiz result for students), #8 (Quiz result details for students), #9 (Results of a quiz for teachers), #10 (Detail results of a quiz for teachers), #11 (Lesson and quiz ratings (Can be extended for multi criteria ratings)), #12 (Courses list), #13 (Add a new course (categories and authors assignement)), #14 (Lessons list for authors), #15 (Create a new lesson with drag and drop slides), #16 (Lesson detail), #17 (Slide content editing), #18 (Create a new quiz with drag and drop questions), #19 (Question with its answers editing)
Please take inspiration from this readme.txt

studypress/Study-Press.php 85% from 13 tests

This is the main PHP file of "StudyPress" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("studypress.php" instead of "Study-Press.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 213 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
Success! There were no dangerous files found in this plugin19,078 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
PHP824,8495679,381
CSS16262807,723
JavaScript115341181,301
PO File1204313421
SVG200252

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.32
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes27.14%
▷ Concrete classes2692.86%
▷ Final classes00.00%
Methods412
▷ Static methods5012.14%
▷ Public methods39796.36%
▷ Protected methods20.49%
▷ Private methods133.16%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants81
▷ Global constants22.47%
▷ Class constants7997.53%
▷ Public constants79100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
31 PNG files occupy 0.33MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prev.png0.58KB0.20KB▼ 65.37%
images/buddypress.png1.90KB1.62KB▼ 14.68%
images/acces.png0.81KB0.98KB0.00%
images/multiple.png2.71KB1.38KB▼ 49.03%
images/profil.png4.68KB3.24KB▼ 30.83%