Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../src/presenta...
File: indexable-presentation.php
}
[500] Fix | Delete
[501] Fix | Delete
/**
[502] Fix | Delete
* Generates the open graph url.
[503] Fix | Delete
*
[504] Fix | Delete
* @return string The open graph url.
[505] Fix | Delete
*/
[506] Fix | Delete
public function generate_open_graph_url() {
[507] Fix | Delete
if ( $this->model->canonical ) {
[508] Fix | Delete
return $this->model->canonical;
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
return $this->permalink;
[512] Fix | Delete
}
[513] Fix | Delete
[514] Fix | Delete
/**
[515] Fix | Delete
* Generates the open graph article publisher.
[516] Fix | Delete
*
[517] Fix | Delete
* @return string The open graph article publisher.
[518] Fix | Delete
*/
[519] Fix | Delete
public function generate_open_graph_article_publisher() {
[520] Fix | Delete
return '';
[521] Fix | Delete
}
[522] Fix | Delete
[523] Fix | Delete
/**
[524] Fix | Delete
* Generates the open graph article author.
[525] Fix | Delete
*
[526] Fix | Delete
* @return string The open graph article author.
[527] Fix | Delete
*/
[528] Fix | Delete
public function generate_open_graph_article_author() {
[529] Fix | Delete
return '';
[530] Fix | Delete
}
[531] Fix | Delete
[532] Fix | Delete
/**
[533] Fix | Delete
* Generates the open graph article published time.
[534] Fix | Delete
*
[535] Fix | Delete
* @return string The open graph article published time.
[536] Fix | Delete
*/
[537] Fix | Delete
public function generate_open_graph_article_published_time() {
[538] Fix | Delete
return '';
[539] Fix | Delete
}
[540] Fix | Delete
[541] Fix | Delete
/**
[542] Fix | Delete
* Generates the open graph article modified time.
[543] Fix | Delete
*
[544] Fix | Delete
* @return string The open graph article modified time.
[545] Fix | Delete
*/
[546] Fix | Delete
public function generate_open_graph_article_modified_time() {
[547] Fix | Delete
return '';
[548] Fix | Delete
}
[549] Fix | Delete
[550] Fix | Delete
/**
[551] Fix | Delete
* Generates the open graph locale.
[552] Fix | Delete
*
[553] Fix | Delete
* @return string The open graph locale.
[554] Fix | Delete
*/
[555] Fix | Delete
public function generate_open_graph_locale() {
[556] Fix | Delete
return $this->open_graph_locale_generator->generate( $this->context );
[557] Fix | Delete
}
[558] Fix | Delete
[559] Fix | Delete
/**
[560] Fix | Delete
* Generates the open graph site name.
[561] Fix | Delete
*
[562] Fix | Delete
* @return string The open graph site name.
[563] Fix | Delete
*/
[564] Fix | Delete
public function generate_open_graph_site_name() {
[565] Fix | Delete
return $this->context->wordpress_site_name;
[566] Fix | Delete
}
[567] Fix | Delete
[568] Fix | Delete
/**
[569] Fix | Delete
* Generates the Twitter card type.
[570] Fix | Delete
*
[571] Fix | Delete
* @return string The Twitter card type.
[572] Fix | Delete
*/
[573] Fix | Delete
public function generate_twitter_card() {
[574] Fix | Delete
return $this->context->twitter_card;
[575] Fix | Delete
}
[576] Fix | Delete
[577] Fix | Delete
/**
[578] Fix | Delete
* Generates the Twitter title.
[579] Fix | Delete
*
[580] Fix | Delete
* @return string The Twitter title.
[581] Fix | Delete
*/
[582] Fix | Delete
public function generate_twitter_title() {
[583] Fix | Delete
if ( $this->model->twitter_title ) {
[584] Fix | Delete
return $this->model->twitter_title;
[585] Fix | Delete
}
[586] Fix | Delete
[587] Fix | Delete
if ( $this->context->open_graph_enabled === true ) {
[588] Fix | Delete
$social_template_title = $this->values_helper->get_open_graph_title( '', $this->model->object_type, $this->model->object_sub_type );
[589] Fix | Delete
$open_graph_title = $this->open_graph_title;
[590] Fix | Delete
[591] Fix | Delete
// If the helper returns a value and it's different from the OG value in the indexable,
[592] Fix | Delete
// output it in a twitter: tag.
[593] Fix | Delete
if ( ! empty( $social_template_title ) && $social_template_title !== $open_graph_title ) {
[594] Fix | Delete
return $social_template_title;
[595] Fix | Delete
}
[596] Fix | Delete
[597] Fix | Delete
// If the OG title is set, let og: tag take care of this.
[598] Fix | Delete
if ( ! empty( $open_graph_title ) ) {
[599] Fix | Delete
return '';
[600] Fix | Delete
}
[601] Fix | Delete
}
[602] Fix | Delete
[603] Fix | Delete
if ( $this->title ) {
[604] Fix | Delete
return $this->title;
[605] Fix | Delete
}
[606] Fix | Delete
[607] Fix | Delete
return '';
[608] Fix | Delete
}
[609] Fix | Delete
[610] Fix | Delete
/**
[611] Fix | Delete
* Generates the Twitter description.
[612] Fix | Delete
*
[613] Fix | Delete
* @return string The Twitter description.
[614] Fix | Delete
*/
[615] Fix | Delete
public function generate_twitter_description() {
[616] Fix | Delete
if ( $this->model->twitter_description ) {
[617] Fix | Delete
return $this->model->twitter_description;
[618] Fix | Delete
}
[619] Fix | Delete
[620] Fix | Delete
if ( $this->context->open_graph_enabled === true ) {
[621] Fix | Delete
$social_template_description = $this->values_helper->get_open_graph_description( '', $this->model->object_type, $this->model->object_sub_type );
[622] Fix | Delete
$open_graph_description = $this->open_graph_description;
[623] Fix | Delete
[624] Fix | Delete
// If the helper returns a value and it's different from the OG value in the indexable,
[625] Fix | Delete
// output it in a twitter: tag.
[626] Fix | Delete
if ( ! empty( $social_template_description ) && $social_template_description !== $open_graph_description ) {
[627] Fix | Delete
return $social_template_description;
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
// If the OG description is set, let og: tag take care of this.
[631] Fix | Delete
if ( ! empty( $open_graph_description ) ) {
[632] Fix | Delete
return '';
[633] Fix | Delete
}
[634] Fix | Delete
}
[635] Fix | Delete
[636] Fix | Delete
if ( $this->meta_description ) {
[637] Fix | Delete
return $this->meta_description;
[638] Fix | Delete
}
[639] Fix | Delete
[640] Fix | Delete
return '';
[641] Fix | Delete
}
[642] Fix | Delete
[643] Fix | Delete
/**
[644] Fix | Delete
* Generates the Twitter image.
[645] Fix | Delete
*
[646] Fix | Delete
* @return string The Twitter image.
[647] Fix | Delete
*/
[648] Fix | Delete
public function generate_twitter_image() {
[649] Fix | Delete
$images = $this->twitter_image_generator->generate( $this->context );
[650] Fix | Delete
$image = \reset( $images );
[651] Fix | Delete
[652] Fix | Delete
// Use a user-defined Twitter image, if present.
[653] Fix | Delete
if ( $image && $this->context->indexable->twitter_image_source === 'set-by-user' ) {
[654] Fix | Delete
return $image['url'];
[655] Fix | Delete
}
[656] Fix | Delete
[657] Fix | Delete
// Let the Open Graph tags, if enabled, handle the rest of the fallback hierarchy.
[658] Fix | Delete
if ( $this->context->open_graph_enabled === true && $this->open_graph_images ) {
[659] Fix | Delete
return '';
[660] Fix | Delete
}
[661] Fix | Delete
[662] Fix | Delete
// Set a Twitter tag with the featured image, or a prominent image from the content, if present.
[663] Fix | Delete
if ( $image ) {
[664] Fix | Delete
return $image['url'];
[665] Fix | Delete
}
[666] Fix | Delete
[667] Fix | Delete
return '';
[668] Fix | Delete
}
[669] Fix | Delete
[670] Fix | Delete
/**
[671] Fix | Delete
* Generates the Twitter creator.
[672] Fix | Delete
*
[673] Fix | Delete
* @return string The Twitter creator.
[674] Fix | Delete
*/
[675] Fix | Delete
public function generate_twitter_creator() {
[676] Fix | Delete
return '';
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
/**
[680] Fix | Delete
* Generates the Twitter site.
[681] Fix | Delete
*
[682] Fix | Delete
* @return string The Twitter site.
[683] Fix | Delete
*/
[684] Fix | Delete
public function generate_twitter_site() {
[685] Fix | Delete
switch ( $this->context->site_represents ) {
[686] Fix | Delete
case 'person':
[687] Fix | Delete
$twitter = $this->user->get_the_author_meta( 'twitter', (int) $this->context->site_user_id );
[688] Fix | Delete
if ( empty( $twitter ) ) {
[689] Fix | Delete
$twitter = $this->options->get( 'twitter_site' );
[690] Fix | Delete
}
[691] Fix | Delete
break;
[692] Fix | Delete
case 'company':
[693] Fix | Delete
default:
[694] Fix | Delete
$twitter = $this->options->get( 'twitter_site' );
[695] Fix | Delete
break;
[696] Fix | Delete
}
[697] Fix | Delete
[698] Fix | Delete
return $twitter;
[699] Fix | Delete
}
[700] Fix | Delete
[701] Fix | Delete
/**
[702] Fix | Delete
* Generates the source.
[703] Fix | Delete
*
[704] Fix | Delete
* @return array The source.
[705] Fix | Delete
*/
[706] Fix | Delete
public function generate_source() {
[707] Fix | Delete
return [];
[708] Fix | Delete
}
[709] Fix | Delete
[710] Fix | Delete
/**
[711] Fix | Delete
* Generates the schema for the page.
[712] Fix | Delete
*
[713] Fix | Delete
* @codeCoverageIgnore Wrapper method.
[714] Fix | Delete
*
[715] Fix | Delete
* @return array The Schema object.
[716] Fix | Delete
*/
[717] Fix | Delete
public function generate_schema() {
[718] Fix | Delete
return $this->schema_generator->generate( $this->context );
[719] Fix | Delete
}
[720] Fix | Delete
[721] Fix | Delete
/**
[722] Fix | Delete
* Generates the breadcrumbs for the page.
[723] Fix | Delete
*
[724] Fix | Delete
* @codeCoverageIgnore Wrapper method.
[725] Fix | Delete
*
[726] Fix | Delete
* @return array The breadcrumbs.
[727] Fix | Delete
*/
[728] Fix | Delete
public function generate_breadcrumbs() {
[729] Fix | Delete
return $this->breadcrumbs_generator->generate( $this->context );
[730] Fix | Delete
}
[731] Fix | Delete
[732] Fix | Delete
/**
[733] Fix | Delete
* Generates the estimated reading time.
[734] Fix | Delete
*
[735] Fix | Delete
* @codeCoverageIgnore Wrapper method.
[736] Fix | Delete
*
[737] Fix | Delete
* @return int|null The estimated reading time.
[738] Fix | Delete
*/
[739] Fix | Delete
public function generate_estimated_reading_time_minutes() {
[740] Fix | Delete
if ( $this->model->estimated_reading_time_minutes !== null ) {
[741] Fix | Delete
return $this->model->estimated_reading_time_minutes;
[742] Fix | Delete
}
[743] Fix | Delete
[744] Fix | Delete
if ( $this->context->post === null ) {
[745] Fix | Delete
return null;
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
// 200 is the approximate estimated words per minute across languages.
[749] Fix | Delete
$words_per_minute = 200;
[750] Fix | Delete
$words = \str_word_count( \wp_strip_all_tags( $this->context->post->post_content ) );
[751] Fix | Delete
return (int) \round( $words / $words_per_minute );
[752] Fix | Delete
}
[753] Fix | Delete
[754] Fix | Delete
/**
[755] Fix | Delete
* Strips all nested dependencies from the debug info.
[756] Fix | Delete
*
[757] Fix | Delete
* @return array
[758] Fix | Delete
*/
[759] Fix | Delete
public function __debugInfo() {
[760] Fix | Delete
return [
[761] Fix | Delete
'model' => $this->model,
[762] Fix | Delete
'context' => $this->context,
[763] Fix | Delete
];
[764] Fix | Delete
}
[765] Fix | Delete
}
[766] Fix | Delete
[767] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function