84% contexto

Code Review | Contexto

WordPress plugin Contexto scored84%from 54 tests.

About plugin

  • Plugin page: contexto
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Apr 6, 2018
  • Latest release: Apr 6, 2018
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: thetwentyseven2727 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /620 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.45ms] Passed 4 tests

Analyzing server-side resources used by Contexto
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.93 ▼0.32
Dashboard /wp-admin3.32 ▼0.0346.86 ▼14.70
Posts /wp-admin/edit.php3.37 ▲0.0248.57 ▲1.24
Add New Post /wp-admin/post-new.php6.18 ▲0.2989.66 ▼20.02
Media Library /wp-admin/upload.php3.24 ▲0.0139.54 ▲1.32

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Contexto
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.24 ▼0.051.62 ▼0.3641.95 ▼5.02
Dashboard /wp-admin2,206 ▲325.57 ▼0.0891.28 ▼1.7477.52 ▲35.72
Posts /wp-admin/edit.php2,117 ▲202.00 ▼0.1537.61 ▲1.5134.75 ▼1.12
Add New Post /wp-admin/post-new.php1,556 ▲3024.10 ▲1.07693.15 ▲13.2365.23 ▼2.68
Media Library /wp-admin/upload.php1,414 ▲144.23 ▲0.05111.72 ▲5.7269.28 ▲24.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/contexto/contexto.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contexto/public/js/tinymce/plugins/contexto/textrazor/contexto.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/contexto/admin/view.php:45
    • > PHP Fatal error
      require_once(): Failed opening required 'CONTEXTO_PLUGIN_DIR/public/js/tinymce/plugins/contexto/textrazor/contexto.php' (include_path='.:/usr/share/php') in wp-content/plugins/contexto/settings.php on line 3
    • > PHP Warning
      require_once(CONTEXTO_PLUGIN_DIR/public/js/tinymce/plugins/contexto/textrazor/contexto.php): failed to open stream: No such file or directory in wp-content/plugins/contexto/settings.php on line 3
    • > PHP Warning
      Use of undefined constant CONTEXTO_PLUGIN_DIR - assumed 'CONTEXTO_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contexto/settings.php on line 3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 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
1 plugin tags: tinymce

contexto/contexto.php Passed 13 tests

The main PHP script in "Contexto" version 1.0 is automatically included on every request by WordPress
84 characters long description:
This is a plugin to generate automatically extra information to enrich your content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin843 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5228110644
CSS1163116
JavaScript191138
Markdown121035
JSON10010

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.43
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods58
▷ Static methods1017.24%
▷ Public methods5798.28%
▷ Protected methods00.00%
▷ Private methods11.72%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/contexto-icon.png0.25KB0.25KB▼ 3.83%
public/images/contexto-tinymce-icon.png0.31KB0.25KB▼ 21.56%