An easy way for content editors to keep track of their work and get notified when it is not working properly
Content Insights for Editors is a WordPress plugin
Content Insights for Editors uses matomo for visitor statistics and helsingborg-stad/broken-link-detector for analysing content.
The package can be downloaded manually and unzipped in the /wp-content/plugins/ directory or by using composer.
Install by running the following command:
composer require municipio/content-insights-for-editors
Example of how composer works here
When resources have been installed. The plugin can be activated by looking for a "Content Insights for Editors" entry in the plugins page and clicking on "Activate".
Here are the hooks for customizing the plugin
cife_notification_mail_logo_url
Example usage
add_action('cife_notification_mail_logo_url', function ($currentLogo) {
$logo = get_field('logotype', 'option');
return wp_get_attachment_url($logo['id']);
});
cife_notification_mail_list_sections
Example usage
add_action('cife_notification_mail_list_sections', function($sections){
array_push($sections, [
'section_header' => '', // string, Title rendered above section
'list' => [
[
'url' => '', // string, list item url
'title' => '', // string, list item title
'value' => 0, // mixed, Value to display in the second column (OPTIONAL)
],
...
],
'list_header' => ['title' => '', 'value' => ''], // array, Explaining list.title and list.value
'no_items_text' => '', // string, Replace list if empty
]);
return $sections;
});
cife_notification_mail_render_section
Example usage
add_action('cife_notification_mail_list_sections', function (
$template,
$sectionVars
) {
if (
$_sectionVars['id'] === 'most-viewed' &&
class_exists('\CustomerFeedback\App')
) {
return CONTENT_INSIGHTS_FOR_EDITORS_MAIL_TEMPLATE_PATH .
'/partials/section-3-cols-customer-feedback.template.php';
}
return $template; // Absolute php file path
});
cife_notification_mail_vars
Exposed variables
'logo' // string, Logourl showed in top of email
'intro_header' // string, Title showen in top of email
'intro_text' // string, Text showen in top of email
'button_cta_text' // string, NULL to hide
'button_cta_url' // string, NULL to hide
Example usage
add_action('cife_notification_mail_vars', function ($html_vars) {
$html_vars['logo'] = "...";
return $html_vars;
});
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See Usage for notes on how to use the plugin in production.
Content Insights for Editors uses matomo for visitor statistics and helsingborg-stad/broken-link-detector for analysing content.
The plugin can be installed with composer or by cloning this repo from github into the /wp-content/plugins/ directory of your WordPress installation.
With composer
Add this to your composer.json
"repositories": [
{
"type": "path",
"url": "/my/local/path/content-insights-for-editors"
},
...
]
"require": {
...
"content-insights-for-editors": "dev-master"
},
And this to install helsingborg-stad/broken-link-detector
"repositories": [
{
"type": "vcs",
"url": "[email protected]:helsingborg-stad/broken-link-detector.git",
"no-api": true
},
...
]
"require": {
...
"helsingborg-stad/broken-link-detector": "^1.3",
},
Then run
composer install
Example of how composer works here
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
We use SemVer for versioning. For the versions available, see the tags on this repository.
See the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details