%s', esc_url( Plugin::getUrl( 'settings' ) ), esc_html__( 'Settings', '404-to-301' ) ),
];
$promo = $this->promoLink();
if ( '' !== $promo ) {
$links[] = $promo;
}
return array_merge( $ours, $links );
}
/**
* Action link promoting whichever of our plugins this site is missing.
*
* Points at the About page rather than wp.org, because the card there installs
* in place. Empty once the site runs both.
*
* @since 4.0.4
*
* @return string Anchor markup, or an empty string.
*/
private function promoLink(): string {
$data = aioseo404To301()->helpers->getPluginData();
$active = static function ( array $keys ) use ( $data ): bool {
foreach ( $keys as $key ) {
if ( ! empty( $data[ $key ]['activated'] ) ) {
return true;
}
}
return false;
};
// AIOSEO leads; a site already running it gets pointed at the next gap.
if ( ! $active( [ 'aioseo', 'aioseoPro' ] ) ) {
$label = __( 'Get AIOSEO', '404-to-301' );
} elseif ( ! $active( [ 'brokenLinkChecker' ] ) ) {
$label = __( 'Get Broken Link Checker', '404-to-301' );
} else {
return '';
}
return sprintf(
'%s',
esc_url( Plugin::getUrl( 'about' ) ),
esc_html( $label )
);
}
/**
* Append the support link to the plugin's row meta.
*
* @since 4.0.0
* @version 4.0.4 Dropped the documentation link.
*
* @param string[] $meta Existing row-meta links.
* @param string $file Plugin basename of the row currently being rendered.
*
* @return array
*/
public function rowMeta( $meta, $file ): array {
$meta = is_array( $meta ) ? $meta : [];
if ( AIOSEO_404_TO_301_PLUGIN_BASENAME === $file ) {
$meta['support'] = sprintf(
'%s',
'https://wordpress.org/support/plugin/404-to-301/',
esc_html__( 'Support', '404-to-301' )
);
}
return $meta;
}
}