Coder Social home page Coder Social logo

lonalore / metatag Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 10.0 315 KB

e107 (v2) plugin - This plugin allows you to automatically provide structured metadata, aka "meta tags", about a website.

License: GNU General Public License v3.0

PHP 96.86% JavaScript 2.74% CSS 0.40%
e107 e107-plugin meta metatags plugin seo

metatag's People

Contributors

gitter-badger avatar lonalore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metatag's Issues

404 issue with images

Hi, I noticed this with images (if they are missing)

you are caching
cid is f.e. site/e107_media/999/images/2019-06/preview_frontend_.png
and
entity type metatag_default
title page (meta tag valur) is "Error"

if I set redirection to the system not found page
cached URL is (at least it's only one, not one recored for each missing image)
/site/?route=system/error/404&type=routeError

Is this correct behaviour?
Thanks

problem with unserialize

I know you are working on it, but there was similar problem before, so maybe this is related to core.

Installed latest version, run update to 1.6.

e107inc/e107#3693

image

#0  e_array->unserialize() called at [***\e107_handlers\e107_class.php:1791]
#1  e107::unserialize() called at [***\e107_plugins\metatag\includes\metatag.class.php:2957]
#2  metatag->getDefaultMetaTagsByType() called at [***\e107_plugins\metatag\includes\metatag.class.php:2865]

$data:

$data = array (
  'title' => '',
  'description' => '',
  'abstract' => '',
  'keywords' => '',
  'news_keywords' => '',
  'standout' => '',
  'rating' => '',
  'referrer' => '',
  'generator' => '',
  'rights' => '',
  'image_src' => '',
  'canonical' => '',
  'shortlink' => '',
  'publisher' => '',
  'author' => '',
  'original-source' => '',
  'prev' => '',
  'next' => '',
  'geo.position' => '',
  'geo.placename' => '',
  'geo.region' => '',
  'icbm' => '',
  'refresh' => '',
  'og:site_name' => '',
  'og:type' => '',
  'og:url' => '',
  'og:title' => '',
  'og:determiner' => '',
  'og:description' => '',
  'og:updated_time' => '',
  'og:see_also' => '',
  'og:image' => '',
  'og:image:url' => '',
  'og:image:secure_url' => '',
  'og:image:type' => '',
  'og:image:width' => '',
  'og:image:height' => '',
  'og:latitude' => '',
  'og:longitude' => '',
  'og:street_address' => '',
  'og:locality' => '',
  'og:region' => '',
  'og:postal_code' => '',
  'og:country_name' => '',
  'og:email' => '',
  'og:phone_number' => '',
  'og:fax_number' => '',
  'og:locale' => '',
  'og:locale:alternate' => '',
  'article:author' => '',
  'article:publisher' => '',
  'article:section' => '',
  'article:tag' => '',
  'article:published_time' => '',
  'article:modified_time' => '',
  'article:expiration_time' => '',
  'profile:first_name' => '',
  'profile:last_name' => '',
  'profile:username' => 'admin',
  'profile:gender' => '',
  'og:audio' => '',
  'og:audio:secure_url' => '',
  'og:audio:type' => '',
  'book:author' => '',
  'book:isbn' => '',
  'book:release_date' => '',
  'book:tag' => '',
  'og:video:url' => '',
  'og:video:secure_url' => '',
  'og:video:width' => '',
  'og:video:height' => '',
  'og:video:type' => '',
  'video:actor' => '',
  'video:actor:role' => '',
  'video:director' => '',
  'video:writer' => '',
  'video:duration' => '',
  'video:release_date' => '',
  'video:tag' => '',
  'video:series' => '',
  'fb:admins' => '',
  'fb:app_id' => '',
  'twitter:card' => '',
  'twitter:site:id' => '',
  'twitter:creator' => '',
  'twitter:creator:id' => '',
  'twitter:url' => '',
  'twitter:title' => '',
  'twitter:description' => '',
  'twitter:image' => '',
  'twitter:image:width' => '',
  'twitter:image:height' => '',
  'twitter:image:alt' => '',
  'twitter:image0' => '',
  'twitter:image1' => '',
  'twitter:image2' => '',
  'twitter:image3' => '',
  'twitter:player' => '',
  'twitter:player:width' => '',
  'twitter:player:height' => '',
  'twitter:player:stream' => '',
  'twitter:player:stream:content_type' => '',
  'twitter:app:country' => '',
  'twitter:app:name:iphone' => '',
  'twitter:app:id:iphone' => '',
  'twitter:app:url:iphone' => '',
  'twitter:app:name:ipad' => '',
  'twitter:app:id:ipad' => '',
  'twitter:app:url:ipad' => '',
  'twitter:app:name:googleplay' => '',
  'twitter:app:id:googleplay' => '',
  'twitter:app:url:googleplay' => '',
  'twitter:label1' => '',
  'twitter:data1' => '',
  'twitter:label2' => '',
  'twitter:data2' => '',
  'dcterms.title' => '',
  'dcterms.creator' => '',
  'dcterms.subject' => '',
  'dcterms.description' => '',
  'dcterms.publisher' => '',
  'dcterms.contributor' => '',
  'dcterms.date' => '',
  'dcterms.type' => '',
  'dcterms.format' => '',
  'dcterms.identifier' => '',
  'dcterms.source' => '',
  'dcterms.language' => '',
  'dcterms.relation' => '',
  'dcterms.coverage' => '',
  'dcterms.rights' => '',
  'itemprop:name' => '',
  'itemprop:description' => '',
  'itemprop:image' => '',
);

PATH: /e107_plugins/download/admin_download.php?mode=main&action=list

Question - about config_alter()

Just for confirmation. I can change only token and default keys. No Name and Tabs. Just to know what to else check.

EDIT: working for tabs

enhancement - add contact page

At first - thank you for this plugin.

But I missing its features on contact page. There is not either default og::image tag. Or maybe I just doing something wrong.

Question - about replace tokens

Hi, just from curiosity.
When you are replacing tokens (in the method preProcessMetaTags() and then replaceTokens() , you are going for each value through all tokens.
F.e. for {news:title} you are going through all news tokens , but you can find right token without loop.
After removing parentheses $value is the direct key of the token.
$string = substr($value, 1, -1); - result: news:title
$tokens = $config[$entity_type]['token'][$string]

I am just curious if I am right or I am missing something. With caching it's quick enough.

warning error with metatag admin_ui

Just report, there were changes in core I think.

Declaration of metatag_admin_ui::beforeUpdate($new_data, $old_data) should be compatible with e_admin_ui::beforeUpdate($new_data, $old_data, $id), Line 218 of G:\php72\htdocs\***\e107_plugins\metatag\admin_config.php

problem with pagination

Download category can be paginated.
Default for url (canonical, og:url) is e_SELF

/**
 * Returns with the current URL.
 */
function metatag_global_token_site_current_page_url()
{
	return defset('e_SELF', '');
}

But each page have different url
for example (you got this url when you click on pagination under list)
/download/category/6/stuff-in-development/?order=id&sort=desc&view=3&from=6
is different that
/download/category/6/stuff-in-development/
but e_SELF returns /download/category/6/stuff-in-development/ for all pages.

e_REQUEST_URL would be probably a better idea

detect news list sometimes fails

It's because this test:

function metatag_entity_news_list_detect()
{
	$page = defset('e_PAGE', '');
	$query = defset('e_QUERY', '');

	if($page == 'news.php' && empty($query))
	{
		return true;
	}

	return false;
}

But values for news list are (query is not empty):

e_PAGE news.php
e_QUERY default.0.0  or e_QUERY default.0.6

Parse error: syntax error

I didn't install this plugin, I just got site where it's installed to install theme. And I got this message:

Parse error: syntax error, unexpected '[' in xxx/e107_plugins/metatag/includes/metatag.page.php on line 184

only on pages, homepage and news works

that line looks like this:
return $date->convert_date(['page']['page_datestamp'], 'short');

Plugin Not Working

Installed today on e107 site and even though I have changed on Global and Front Page tags to be {site:name} only, it still doen't change the title bar. Still reads PageTitle - SiteName

Thanks

Question - just discussion

Hi, I am trying to find the solution on how to use your plugin without any code changes or without creating a new plugin for this.

What I am trying to do:
for
$config['download-category']
add new token if plugin is installed

'download:category:canonical' => array(
					'help'    => 'Canonical url',
					'handler' => 'metatag_entity_download_category_token_canurl',
					'file'    => '{e_PLUGIN}jmdownload/includes/metatag.canonical.php',
),

and change default

'default' => array(
'og:canonical'             => '{download:category:canonical}',
)

I have working solution with jmdownload plugin where I have my own browser of download categories with new event "jmdownload-category"

I could:

  1. to require with jmcanonical plugin to install jmdownload, but I dislike this. That plugin is the only solution for missing core functionality and it's planned to remove it during the time. It's a personal solution, it's not shared.

  2. I tried to add e_metatag and e_event and tokens to jmcanonical plugin, but it was ignored. Or I did it the wrong way.
    Is possible override/change settings for e_metatag with another plugin? I think it depends on the order of loading addons. the metatag is after jmcanonical and so it's config is used.

Any ideas? Thanks

next problem with serialize

After new installation (deleting tables)
There is the database error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'data' cannot be null
[PREPARE] => INSERT INTO e107jm_metatag_default (name,type,parent,data) VALUES (:name, :type, :parent, :data)

My guess is that it's because using serialize - database field can't be null in that case. Normally there would be for empty value saved with json_encode() some text, but e107 version is saving null data.

I run to this problem some days ago and discussed on gitter.

this is solution:

image

there is more, you can find it around that datetime in main room

where to set e_PAGETITLE

Hi,
I want to use global setting for plugin I am working on (first option). I have set:
{site:current-page:title} | {site:name}

that value is from

	$page_name = defset('PAGE_NAME', '');
	return defset('e_PAGETITLE', $page_name);

I have set it in e_header.php of that plugin, I see filled <title> tag of page (probably core thing)
but this tag is not filled:

<meta content=" | sitename" name="title" />

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.