83% easycontent

Code Review | EasyContent

WordPress plugin EasyContent scored83%from 54 tests.

About plugin

  • Plugin page: easycontent
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2019
  • Latest release: Nov 15, 2023
  • Number of updates: 42
  • Update frequency: every 35.1 days
  • Top authors: easycontent (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /1,951 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.44MB] [CPU: ▲5.62ms] Passed 4 tests

An overview of server-side resources used by EasyContent
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4548.13 ▲6.33
Dashboard /wp-admin3.75 ▲0.4455.56 ▲12.26
Posts /wp-admin/edit.php3.80 ▲0.4453.48 ▲5.40
Add New Post /wp-admin/post-new.php6.44 ▲0.54101.62 ▼1.26
Media Library /wp-admin/upload.php3.67 ▲0.4445.04 ▲12.00
EasyContent connection /wp-admin/admin.php?page=easycontent-connection3.6839.61

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 221 new files
Database: 4 new tables, 7 new options
New tables
wp_easycontent_article_post
wp_easycontent_category
wp_easycontent_article
wp_easycontent_workflow_stage
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
ec-current-db-version
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by EasyContent
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲2414.34 ▲0.021.72 ▼0.3344.78 ▼0.48
Dashboard /wp-admin2,219 ▲455.61 ▲0.1083.79 ▼3.3038.70 ▼0.87
Posts /wp-admin/edit.php2,149 ▲461.99 ▲0.0539.48 ▼0.7036.04 ▼0.65
Add New Post /wp-admin/post-new.php1,607 ▲8124.33 ▲1.35646.96 ▲43.2937.26 ▼24.43
Media Library /wp-admin/upload.php1,421 ▲184.16 ▲0.02101.70 ▲2.9144.69 ▲1.58
EasyContent connection /wp-admin/admin.php?page=easycontent-connection8332.0027.0425.81

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 81× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/easycontent/views/admin/pages/publishing-options.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PhpGangsters\\EasyContent\\HtmlHandler\\Parsers\\BaseParser' not found in wp-content/plugins/easycontent/vendor/mihaoo/easycontent-html-handler/src/Parsers/SrcsetParser.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'EasyContent\\WordPress\\Implementation\\Db\\Migration' not found in wp-content/plugins/easycontent/app/Implementation/Db/Migrations/InitialMigration.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'EasyContent\\WordPress\\Implementation\\Form\\Defaults\\DefaultsProvider' not found in wp-content/plugins/easycontent/app/Implementation/Form/Defaults/ImageProcessingFormDefaults.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'EasyContent\\WordPress\\Rest\\Actions\\BaseAction' not found in wp-content/plugins/easycontent/app/Rest/Actions/GetArticleDetails.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'EasyContent\\WordPress\\Source\\Api\\Entity\\Entity' not found in wp-content/plugins/easycontent/app/Source/Api/Entity/Category.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/easycontent/views/admin/notices/db-is-not-up-to-date.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/easycontent/views/admin/notices/base.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'EasyContent\\WordPress\\Source\\Entity\\WorkflowStatusStorage' not found in wp-content/plugins/easycontent/app/Implementation/Entity/DbWorkflowStatusStorage.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'EasyContent\\WordPress\\Source\\Entity\\PositiveInteger' not found in wp-content/plugins/easycontent/app/Source/Entity/Article/ArticleId.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Page that allows you to import one or several EasyContent articles into your Wordpress website.), #2 (Add your EasyContent API keys into the 'EasyContent connection' tab to connect your website to EasyContent.), #3 (The 'Publishing options' tab allows you to configure some default options for your imported posts or pages.), #4 (Bulk Push and Pull operations are available on your 'All posts' page.), #5 (Once the posts or pages are linked, you'll see their EasyContent status in the 'EasyContent status' column.), #6 (Our plugin works well with Gutenberg. While editing your page or post in Wordpress, you can push it to EasyContent or pull new content from EasyContent to Wordpress.), #7 (The plugin can resize and/or compress your images while importing them from EasyContent into your Wordpress media library.)
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

easycontent/easycontent-wp.php 85% from 13 tests

This is the main PHP file of "EasyContent" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("easycontent.php" instead of "easycontent-wp.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin24,123 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript63,1752,50211,623
PHP1872,5512,6489,942
CSS10981081,656
PO File1168179399
HTML1766343
JSON300160

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity5.90
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces52
Interfaces14
Traits0
Classes153
▷ Abstract classes74.58%
▷ Concrete classes14695.42%
▷ Final classes10370.55%
Methods814
▷ Static methods11313.88%
▷ Public methods64078.62%
▷ Protected methods617.49%
▷ Private methods11313.88%
Functions19
▷ Named functions15.26%
▷ Anonymous functions1894.74%
Constants92
▷ Global constants88.70%
▷ Class constants8491.30%
▷ Public constants84100.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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/vendor/jquery-ui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/css/vendor/jquery-ui/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
assets/css/vendor/jquery-ui/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
assets/css/vendor/jquery-ui/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/css/vendor/jquery-ui/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%