add_hooks();
/* Development */
// define('API_HOST', 'http://api.probar.atomicreach.com');
// define('AR_URL', 'http://probar.atomicreach.com');
//define('AR_URL', 'http://arv3.local');
/* Staging */
// define('API_HOST', 'https://api.dev.arv3.atomicreach.com'); // with SSL
// define('AR_URL', 'http://dev.arv3.atomicreach.com');
//
/* Production */
define( 'API_HOST', 'https://app.atomicreach.com' ); // with SSL
define( 'AR_URL', '//score.atomicreach.com' );
define( 'AR_APP', '//new.atomicreach.com/' );
/* Staging */
// define( 'API_HOST', 'https://api-staging.atomicreach.com' );
// define( 'AR_URL', '//staging.atomicreach.com/' );
// define( 'AR_APP', '//dev-my.atomicreach.com/' );
// if( !class_exists( 'WP_Http' ) )
// require_once( ABSPATH . WPINC . '/class-http.php' );
/*********************/
/* Metabox functions */
/*********************/
function aranalyzer_metabox_init() {
// wp_enqueue_script( 'ar_meta_js', MY_PLUGIN_PATH . '/custom/meta.js', array( 'jquery' ) );
wp_enqueue_script( 'ar_ftu_js', MY_PLUGIN_PATH . 'custom/js/writer.js', array( 'jquery' ) );
wp_enqueue_script( 'ar_tooltipsy_js', MY_PLUGIN_PATH . 'custom/js/tooltipsy.min.js', array( 'jquery' ) );
wp_enqueue_script( 'ar_atomic_editor_js', MY_PLUGIN_PATH . 'custom/js/atomicreach.js', array( 'jquery' ) );
wp_enqueue_script( 'ar_atomic_editor_mark_js', MY_PLUGIN_PATH . 'custom/js/mark.js', array( 'jquery' ) );
wp_enqueue_style( 'ar_meta_css', MY_PLUGIN_PATH . 'custom/style/newMeta.css' );
wp_enqueue_script( 'ar_highlightRegex_js', MY_PLUGIN_PATH . 'highlightRegex/highlightRegex.js', array( 'jquery' ) );
//wp_enqueue_script('ar_customDictionaryContextMenu_js', MY_PLUGIN_PATH . '/customDictionaryContextMenu/editor_plugin.js', array('jquery'));
// review the function reference for parameter details
// http://codex.wordpress.org/Function_Reference/add_meta_box
// add a meta box for each of the wordpress page types: posts and pages and all custom ones
// get all the post types excluding default ones
$arg_post_types = array(
'public' => TRUE,
'_builtin' => FALSE
);
$post_types = get_post_types( $arg_post_types, 'names' );
// add post and pages as well.
if(get_bloginfo('version') >= 4.6) {
array_push($post_types, 'post', 'page');
foreach ($post_types as $type) {
add_meta_box('aranalyzer_metabox', 'Atomic Reach
', 'aranalyzer_metabox_setup', $type, 'side', 'high');
}
}
}
add_action( 'admin_init', 'aranalyzer_metabox_init' );
/**
* Registers an editor stylesheet for the theme.
*/
function wpdocs_theme_add_editor_styles() {
add_editor_style( MY_PLUGIN_PATH . 'custom/style/inEditor.css' );
add_editor_style( MY_PLUGIN_PATH . 'custom/style/ionicons.min.css' );
}
add_action( 'admin_init', 'wpdocs_theme_add_editor_styles' );
/* oAuth check: this function check if the secret and consumer keys were set.
* This event will happen after doing a click on the Connect to AR button
* in the AR Optimizer section and the modal windows return those values
* after login to Atomic Reach site
*
* */
function aranalyzer_oAuth_check() {
if ( isset( $_GET['mode'] ) && isset( $_GET['key'] ) && isset( $_GET['secret'] ) ) {
if ( $_GET['mode'] == 'ar_callback' ) {
update_option( 'aranalyzer_secretkey', '' );
update_option( 'aranalyzer_consumerkey', '' );
if ( update_option( 'aranalyzer_secretkey', $_GET['secret'] ) && update_option( 'aranalyzer_consumerkey', $_GET['key'] ) ) {
update_option( 'aranalyzer_state_keys', 'TRUE' );
update_option( 'aranalyzer_create', 1);
// update_option( 'aranalyzer_performance', 1);
update_option( 'aranalyzer_recommendation', 1);
echo '
';
} else {
echo '
';
}
exit();
}
}
}
add_action( 'admin_init', 'aranalyzer_oAuth_check' );
/* End oAuth check */
/* oAuth Callback response from modal windows. This function will prevent reload the WP site inside
* the modal windows.(see file modal/js/modal.windows.js)
**/
function aranalyzer_check_keys_callback() {
if ( isset( $_POST['modekeys'] ) ) {
echo TRUE;
exit();
}
}
add_action( 'admin_init', 'aranalyzer_check_keys_callback' );
function aranalyzer_metabox_setup() {
global $post;
// using an underscore, prevents the meta variable
// from showing up in the custom fields section
$scoring = get_post_meta( $post->ID, '_ar_scoring', TRUE );
$ar_enabled = get_post_meta( $post->ID, '_ar_meta_review_enabled', TRUE );
$ar_audience = get_post_meta( $post->ID, '_ar_meta_audience_list', TRUE );
// will return TRUE if the keys have been set correctly in AR Optimizer (modal windows login to AR)
$ar_state_keys = get_option( 'aranalyzer_state_keys' );
$consumerKey = get_option( 'aranalyzer_consumerkey' );
$secretKey = get_option( 'aranalyzer_secretkey' );
if ( empty( $consumerKey ) && empty( $secretKey ) ) {
// grabs the HTML file to display the form.
$doc = new DOMDocument();
$doc->loadHTMLFile( plugin_dir_path( __FILE__ ) . "custom/html/go-to-create.html" );
echo $doc->saveHTML();
} else {
// $doc = new DOMDocument();
//// $doc->loadHTMLFile( plugin_dir_path( __FILE__ ) . "custom/html/ftu.html" );
// $doc->loadHTMLFile( plugin_dir_path( __FILE__ ) . "custom/html/go-to-create.html" );
// echo $doc->saveHTML();
require_once( MY_PLUGIN_FOLDER . '/custom/html/go-to-create.php' );
// include(plugin_dir_path( __FILE__ ) . "custom/html/go-to-create.php");
}
}
/*************************/
/* Metabox Functions End */
/*************************/
/*************************/
/* API Interaction */
/*************************/
function aranalyzer_api_getmetadata( $consumerKey, $secretKey, $title, $content, $segmentId ) {
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$host = API_HOST;
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$result = $apiClient->analyzePost( $content, $title, $segmentId );
return $result;
}
// get 5 bands.
function aranalyzer_api_getsophisticationbandlist( $consumerKey, $secretKey ) {
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$host = API_HOST;
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$result = $apiClient->getSophisticationBandList();
return $result;
}
function aranalyzer_api_getaudiencelist( $consumerKey, $secretKey ) {
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$host = API_HOST;
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$result = $apiClient->getAudienceList();
return $result;
}
function ar_analyzer_custom_dictionary() {
$success = FALSE;
$word = $_GET['word'];
if ( $word ) {
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$host = API_HOST;
$consumerKey = get_option( 'aranalyzer_consumerkey' );
$secretKey = get_option( 'aranalyzer_secretkey' );
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$result = $apiClient->addDictionary( $word );
if ( $result->status == AR_Client::STATUS_OK ) {
$success = TRUE;
}
}
echo $success ? 'OK' : 'ERROR';
exit();
}
add_action( 'wp_ajax_ar_analyzer_custom_dictionary', 'ar_analyzer_custom_dictionary' );
function aranalyzer_admin() {
$current_user = wp_get_current_user();
$accessToken = new AccessToken();
$accessToken->show_user_profile($current_user);
// this option will have the state of the keys in case of error will set to FALSE
$ar_state_keys = get_option( 'ar_state_keys' );
require_once( 'ar_analyzer_admin.php' );
}
function aranalyzer_admin_actions() {
wp_enqueue_script( 'ar_simple.modal_js', MY_PLUGIN_PATH . 'modal/js/jquery.simplemodal.js', array( 'jquery' ) );
wp_enqueue_script( 'ar_modal.windows_js', MY_PLUGIN_PATH . 'modal/js/modal.windows.js', array( 'jquery' ) );
wp_enqueue_style( 'ar_modal_css', MY_PLUGIN_PATH . 'modal/css/modal-windows.css' );
add_menu_page( "Atomic Reach Configuration", "Atomic Reach", "manage_options", "ar-analyzer-admin", "aranalyzer_admin",
plugin_dir_url( __FILE__ ) . "custom/imgs/ar-logo-icon.png" );
}
add_action( 'admin_menu', 'aranalyzer_admin_actions' );
function aranalyzer_review( $post_ID = 0 ) {
if ( $post_ID == 0 ) {
$post_ID = intval( $_POST['postID'] );
$arajax = 1;
}
// code by Sergio
global $wp_version;
if ( version_compare( $wp_version, '3.8', '<' ) ) {
global $flag;
if ( $flag != 1 ) {
$flag = 1;
return;
}
}
// End Sergio Code
// if (!session_id()) {
// session_start();
// }
// Get post information
$post_info = get_post( $post_ID );
$title = $post_info->post_title;
/**
* We are removing the wptexturize before creating the content value to be send to api because it is changing single quotes
* with #8217 char and if makes the analysis fail.
*
* check
* http://codex.wordpress.org/Function_Reference/wptexturize
*/
remove_filter( 'the_content', 'wptexturize' );
$content = apply_filters( 'the_content', $post_info->post_content );
add_filter( 'the_content', 'wptexturize' );
$ar_api_status = TRUE;
$ar_api_error = "";
// Save the analizer is active option
$meta_key = '_ar_meta_review_enabled';
$value = ( isset( $_POST[ $meta_key ] ) ? $_POST[ $meta_key ] : '' );
delete_post_meta( $post_ID, $meta_key );
add_post_meta( $post_ID, $meta_key, $value, TRUE );
if ( $value === "enabled" ) {
$analyzer_active = TRUE;
}
// Save the audience list option selected
$meta_key = '_ar_meta_audience_list';
$segmentId = $value = ( isset( $_POST[ $meta_key ] ) ? $_POST[ $meta_key ] : '' );
delete_post_meta( $post_ID, $meta_key );
add_post_meta( $post_ID, $meta_key, $value, TRUE );
if ( isset( $analyzer_active ) ) {
if ( $analyzer_active ) {
/* After a long time looking through formatting functions *
* I found this combination that left HTML code without encoding and *
* all the other text formatted with HTML entities encoding */
$title = htmlspecialchars_decode( htmlentities( $title, ENT_NOQUOTES, 'UTF-8', FALSE ), ENT_NOQUOTES );
$content = htmlspecialchars_decode( htmlentities( $content, ENT_NOQUOTES, 'UTF-8', FALSE ), ENT_NOQUOTES );
// Call the API with the post contents.
$consumerKey = get_option( 'aranalyzer_consumerkey' );
$secretKey = get_option( 'aranalyzer_secretkey' );
$scoringObj = aranalyzer_api_getmetadata( $consumerKey, $secretKey, $title, $content, $segmentId );
if ( $arajax == 1 ) {
echo $scoringObj;
}
// delete_post_meta($post_ID, '_ar_api_status');
update_option( 'aranalyzer_state_keys', 'TRUE' );
if ( isset( $scoringObj->error ) ) {
// delete_post_meta($post_ID, '_ar_api_error');
// add_post_meta($post_ID,'_ar_api_error', $scoringObj->error, TRUE);
// add_post_meta($post_ID,'_ar_api_status', 'FALSE', TRUE);
update_option( 'aranalyzer_state_keys', 'FALSE' );
$_SESSION['_ar_api_error'] = $scoringObj->error;
} else {
$_SESSION['_ar_api_error'] = FALSE;
// Fix the special case when only one suggestion comes in the spelling options
foreach ( $scoringObj->data->analysis->sm->detail as $key => $value ) {
if ( isset( $value->suggestions->option ) ) {
if ( ! is_array( $value->suggestions->option ) ) {
$value->suggestions->option = array( $value->suggestions->option );
}
}
}
// Fix the special case when only one suggestion comes in the grammar options
foreach ( $scoringObj->data->analysis->gm->detail as $key => $value ) {
if ( isset( $value->suggestions->option ) ) {
if ( ! is_array( $value->suggestions->option ) ) {
$value->suggestions->option = array( $value->suggestions->option );
}
}
}
delete_post_meta( $post_ID, '_ar_scoring' );
// Update metadata and recover it again to update the UI.
$current_data = get_post_meta( $post_ID, '_ar_scoring', TRUE );
if ( $current_data ) {
update_post_meta( $post_ID, '_ar_scoring', $scoringObj );
} elseif ( ! is_null( $scoringObj ) ) {
add_post_meta( $post_ID, '_ar_scoring', $scoringObj, TRUE );
}
}
} else {
delete_post_meta( $post_ID, '_ar_scoring' );
}
}
}
/* hook when click on update */
// add_action( 'publish_post', 'aranalyzer_review' );
/* hook when save draft post */
// add_action( 'save_post', 'aranalyzer_review' );
/**
* Used to load the required files on the plugins_loaded hook, instead of immediately.
*
*/
function aranalyzer_tracking_admin_init() {
$opt_in = get_option( 'aranalyzer_tracking' );
if ( isset( $opt_in ) && $opt_in ) {
require_once( MY_PLUGIN_FOLDER . '/includes/ARTracking.php' );
$ar_tracking = new AR_Tracking( API_HOST );
}
}
/**
* checks if the Dashboard or the administration panel is attempting to be displayed
* http://codex.wordpress.org/Function_Reference/is_admin
*/
if ( is_admin() ) {
add_action( 'plugins_loaded', 'aranalyzer_tracking_admin_init' );
}
/**
* Used to get the state to be display in scoring list comparing recommended words against sentences
*
*/
function aranalyzer_get_state( $dpObject ) {
if ( ! isset( $dpObject->scoring ) ) {
$scoring = 40; // add text in case there is not a value
} else {
$scoring = $dpObject->scoring;
}
$dpObject = $dpObject->analysis;
$aColorText = array();
if ( $scoring <= 33 ) {
$aColorText = array(
'arBarColor' => 'red',
'arText' => 'Content edits are needed',
'scoring' => $scoring,
);
} elseif ( $scoring > 33 && $scoring <= 66 ) {
$aColorText = array(
'arBarColor' => 'yellow',
'arText' => 'Content edits are recommended',
'scoring' => $scoring,
);
} else {
$aColorText = array(
'arBarColor' => 'green',
'arText' => 'Content refinements are suggested',
'scoring' => $scoring,
);
}
return $aColorText;
}
/*********************/
/* TinyMCE custom functions */
/*********************/
function tiny_mce_custom_plugins() {
global $wp_version;
if ( version_compare( $wp_version, '3.9', '<' ) ) {
return array( 'customdictionarycontextmenu' => MY_PLUGIN_PATH . 'customDictionaryContextMenu/editor_plugin.js' );
} else {
return array( 'customdictionarycontextmenu' => MY_PLUGIN_PATH . 'customDictionaryContextMenu/plugin.js' );
}
}
add_filter( 'mce_external_plugins', 'tiny_mce_custom_plugins' );
/** plugin Tour * */
add_action( 'wp_ajax_aranalyzer_ajax', 'aranalyzer_ajax_callback' );
add_action( 'wp_ajax_arTrackClicks_ajax', 'arTrackClicks_ajax_callback' );
add_action( 'wp_ajax_disconnect_ajax', 'disconnect_ajax_callback' );
add_action( 'wp_ajax_awSignUpEmail_ajax', 'awSignUpEmail_ajax_callback' );
add_action( 'wp_ajax_awSignInEmail_ajax', 'awSignInEmail_ajax_callback' );
add_action( 'wp_ajax_awCheckScoreFreq_ajax', 'awCheckScoreFreq_ajax_callback' );
function awSignInEmail_ajax_callback() {
if ( isset( $_POST['email'] ) ) {
$email = $_POST['email'];
}
if ( isset( $_POST['pass'] ) ) {
$pass = $_POST['pass'];
}
if ( isset( $email ) && isset( $pass ) ) {
$host = API_HOST;
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$apiClient = New AR_Client( $host, '', '', $email, $pass );
$apiClientv2 = New AR_Client($host,$apiClient->key,$apiClient->secret);
if ( $apiClient->key != "" && $apiClient->secret != "" ) {
$accessToken = new AccessToken();
$current_user = wp_get_current_user();
$data['user_id'] = $current_user->data->ID;
$data['name'] = $current_user->data->user_login;
$passwordData = $accessToken->rest_add_application_password($data);
$accessToken->set_user_application_passwords($data['user_id'],$passwordData);
$apiClient->init();
$apiClient->setAppName("WP");
$result = $apiClient->connectWordPress($passwordData['password'],$data['name'] ,site_url());
update_option( 'aranalyzer_consumerkey', $apiClient->key );
update_option( 'aranalyzer_secretkey', $apiClient->secret );
update_option( 'aranalyzer_state_keys', 'TRUE' );
hubspotCall($email,"signin");
echo json_encode($result);
die();
} else {
echo $apiClient->errorMessage;
}
} else {
die( "error" );
}
}
function awSignUpEmail_ajax_callback() {
if ( isset( $_POST['email'] ) ) {
$email = $_POST['email'];
}
if ( isset( $_POST['pass'] ) ) {
$pass = $_POST['pass'];
}
if ( isset( $email ) && isset( $pass ) ) {
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$apiClient = New AR_Client( API_HOST, "", "", "", "" );
$res = $apiClient->createAccount( $email, $pass );
if ( $res->status == 10 ) {
update_option( 'aranalyzer_consumerkey', $res->data->consumerKey );
update_option( 'aranalyzer_secretkey', $res->data->consumerSecret );
update_option( 'aranalyzer_accountId', $res->data->accountId );
echo "ok-" . $res->data->accountId;
hubspotCall($email,"signup");
die();
} else {
echo json_encode( $res );
die();
}
} else {
die( "error" );
}
}
function hubspotCall( $email, $form ){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://my.atomicreach.com/hubspot-listener.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
http_build_query(array(
'email' => $email
,'tag' => 'wordpress_signup'
,'form' => $form
)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );
$server_output = curl_exec ($ch);
curl_close ($ch);
return json_decode( $server_output );
}
function aranalyzer_hatchbuckIntegration( $email ) {
require_once( MY_PLUGIN_FOLDER . '/custom/class/Hatchbuck.php' );
$hb = new Hatchbuck();
$r = $hb->search( $email );
if ( ! $r ) {
$data = '{
"emails": [ { "address": "' . $email . '" ,
"type": "Work"}],
"status":{"id": "R000dFZxWHdUSDhFT3d5TGp4UXUzSmg3cEVuS2Iwa1ZyMFpIOHktNm1WbzE1"}
}';
$addUser = $hb->addNewUser( $data );
if ( $addUser ) {
$tag = '{"id": "RkNBVkhGcWtoTUt1a1RXM1lzVXlyTG9hNlNIY0FDOUIzWWVscWVRb1RMWTE1"}';
$hb->addTag( $email, $tag );
}
} else {
$tag = '{"id": "RkNBVkhGcWtoTUt1a1RXM1lzVXlyTG9hNlNIY0FDOUIzWWVscWVRb1RMWTE1"}';
$hb->addTag( $email, $tag );
}
}
function arTrackClicks_ajax_callback() {
// update_option( 'create-click', 0);
// update_option( 'performance-click', 0);
// update_option( 'recommendation-click', 0);
// $count = get_option($_POST['value'].'-click');
$count = get_option('aranalyzer_'.$_POST['value']);
update_option('aranalyzer_'.$_POST['value'],$count+1);
// update_option('aranalyzer_create',4);
echo $count;
}
function aranalyzer_ajax_callback() {
update_user_option( get_current_user_id(), 'arLastScoreDate', date( 'Y-m-d' ) );// saves the latest date of when user scores.
/*$postID = intval($_POST['postID']);
$post_info = get_post($postID);
$title = $post_info->post_title;*/
$_title = $_POST['arTitle'];
$_content = $_POST['arContent'];
/**
* We are removing the wptexturize before creating the content value to be send to api because it is changing single quotes
* with #8217 char and if makes the analysis fail.
*
* check
* http://codex.wordpress.org/Function_Reference/wptexturize
*/
/*remove_filter('the_content', 'wptexturize');
$content = apply_filters('the_content', $post_info->post_content);
add_filter('the_content', 'wptexturize');*/
// $ar_audience = get_post_meta($postID, '_ar_meta_audience_list', TRUE);
$ar_api_status = TRUE;
$ar_api_error = "";
// if ($analyzer_active) {
/* After a long time looking through formatting functions *
* I found this combination that left HTML code without encoding and *
* all the other text formatted with HTML entities encoding */
$title = htmlspecialchars_decode( htmlentities( $_title, ENT_NOQUOTES, 'UTF-8', FALSE ), ENT_NOQUOTES );
$content = htmlspecialchars_decode( htmlentities( $_content, ENT_NOQUOTES, 'UTF-8', FALSE ), ENT_NOQUOTES );
// Call the API with the post contents.
$consumerKey = get_option( 'aranalyzer_consumerkey' );
$secretKey = get_option( 'aranalyzer_secretkey' );
$segmentId = $_POST['segmentId'];
$host = API_HOST;
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$apiClient->setAppName("WP");
$scoring = $apiClient->analyzePost( $content, $title, NULL, NULL, $segmentId );
$atomicScore = $apiClient->getAtomicScore();
$output = get_score( $scoring, $segmentId, $atomicScore->atomicScore ); //call get_score
// Return the String
die( $output );
}
function disconnect_ajax_callback(){
$consumerKey = get_option( 'aranalyzer_consumerkey' );
$secretKey = get_option( 'aranalyzer_secretkey' );
$host = API_HOST;
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$apiClient->setAppName("WP");
$atomicScore = $apiClient->disconnectWordPress();
// $atomicScore = $apiClient->getAudienceList();
$output = $atomicScore;
delete_option( 'aranalyzer_tracking' );
delete_option( 'aranalyzer_view' );
delete_option( 'aranalyzer_RSS' );
delete_option( 'aranalyzer_consumerkey' );
delete_option( 'aranalyzer_secretkey' );
delete_option( 'aranalyzer_state_keys' );
delete_option( 'arActivatedDate' );
delete_option( 'aranalyzer_create');
//delete_option( 'aranalyzer_performance');
delete_option( 'aranalyzer_recommendation');
die( $output );
}
function checkWorPressConnection(){
$consumerKey = get_option( 'aranalyzer_consumerkey' );
$secretKey = get_option( 'aranalyzer_secretkey' );
$host = API_HOST;
require_once( MY_PLUGIN_FOLDER . '/includes/ARClient.php' );
$apiClient = New AR_Client( $host, $consumerKey, $secretKey );
$apiClient->init();
$apiClient->setAppName("WP");
$atomicScore = $apiClient->checkWordPressConnection();
$output = $atomicScore;
return $output;
}
function get_score( $result, $segmentId, $atomicScore ) {
if ( $result->status == AR_Client::STATUS_OK ) {
include( MY_PLUGIN_FOLDER . '/custom/class/meta.php' );
include( MY_PLUGIN_FOLDER . '/custom/html/popups.php' );
$Output = NEW meta( $result, $segmentId, $atomicScore );
$score = '';
// Display Score card.
// $score .= '
Use the toggles to highlight content and make changes to improve your article score.
'; $score .= ''; $score .= '