Coder Social home page Coder Social logo

alfredoramos / phpbb-ext-seo-metadata Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 7.0 1.64 MB

SEO Metadata extension for phpBB

License: GNU General Public License v2.0

PHP 90.62% HTML 9.38%
phpbb phpbb-extension seo seo-meta metadata open-graph json-ld schema-org microdata rdf twitter-cards

phpbb-ext-seo-metadata's Introduction

About

SEO Metadata extension for phpBB

Build Status Latest Stable Version Code Quality Translation Progress License

Add dynamically generated meta tags and microdata (Open Graph, Twitter Cards and JSON-LD) of your forums and topics to improve SEO of your board and show correct information when you share it on social networks, including (but not limited to) Telegram, WhatsApp, Facebook, Twitter and Vkontakte.

If available, it will dynamically generate and include the following data inside the <head> tag:

Meta description

<meta name="description" content="...">

Open Graph

<meta property="fb:app_id" content="...">
<meta property="og:locale" content="...">
<meta property="og:site_name" content="...">
<meta property="og:url" content="...">
<meta property="og:type" content="article">
<meta property="og:title" content="...">
<meta property="og:description" content="...">
<meta property="og:image" content="...">
<meta property="og:image:type" content="...">
<meta property="og:image:width" content="...">
<meta property="og:image:height" content="...">
<meta property="article:published_time" content="...">
<meta property="article:section" content="...">
<meta property="article:publisher" content="...">

Twitter Cards

<meta name="twitter:card" content="summary|summary_large_image">
<meta name="twitter:site" content="...">
<meta name="twitter:title" content="...">
<meta name="twitter:description" content="...">
<meta name="twitter:image" content="..">

JSON-LD

<script type="application/ld+json">
{
	"@context": "https://schema.org",
	"@type": "DiscussionForumPosting",
	"url": "...",
	"headline": "...",
	"description": "...",
	"text": "...",
	"image": "...",
	"author": {
		"@type": "Person",
		"name": "..."
	},
	"datePublished": "...",
	"articleSection": "...",
	"publisher": {
		"@type": "Organization",
		"name": "...",
		"url": "...",
		"logo": {
			"@type": "ImageObject",
			"url": "...",
			"width": "...",
			"height": "..."
		}
	}
}
</script>

Features

  • Dynamically generated Open Graph, Twitter Cards meta tags and JSON-LD microdata from your board data and current page
  • Dynamic description
  • Set default image for Open Graph and JSON-LD
  • Set how description will be generated
  • ACP settings to enable/disable Open Graph, Twitter Cards and JSON-LD
  • Support for attachments, for topic image
  • Generate meta data for specific posts

Requirements

  • PHP 7.1.3 or greater
  • phpBB 3.3 or greater

Support

Donate

If you like or found my work useful and want to show some appreciation, you can consider supporting its development by giving a donation.

Donate with PayPal Donate with Stripe
Donate with PayPal Donate with Stripe

Installation

  • Download the latest release
  • Decompress the *.zip or *.tar.gz file
  • Copy the files and directories inside {PHPBB_ROOT}/ext/alfredoramos/seometadata/
  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Enable and confirm

Preview

Global settings Open Graph, Twitter Cards and JSON-LD settings Generated markup

(Click to view in full size)

Configuration

  • Go to your Administration Control Panel > Extensions > SEO Metadata settings
  • Change settings as needed
  • Click on Submit

Uninstallation

  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Disable and confirm
  • Go back to Manage extensions > SEO Metadata > Delete data and confirm

Upgrade

  • Go to your Administration Control Panel > Customize > Manage extensions
  • Click on Disable and confirm
  • Delete all the files inside {PHPBB_ROOT}/ext/alfredoramos/seometadata/
  • Download the new version
  • Upload the new files inside {PHPBB_ROOT}/ext/alfredoramos/seometadata/
  • Enable the extension again

phpbb-ext-seo-metadata's People

Contributors

alfredoramos avatar dependabot[bot] avatar dezash avatar github-actions[bot] avatar imgbotapp avatar michaing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

phpbb-ext-seo-metadata's Issues

Specific post-based metadata (direct links)

i was thinking that it would be cool to have an option for metadata derived from specific posts when a specific post is linked to.

so, for a url like this: https://www.example.com/viewtopic.php?t=20
the metadata is derived from the first post of topic 20. perfect.

however, for a url like this: https://www.example.com/viewtopic.php?t=20&p=101
this is a link referring to a specific post in that topic (post id 101).
it would be nice to have an option to enable deriving metadata from post 101 instead of the first post of topic 20.
which metadata?
use the overall topic title for title (same as the current behavior), but maybe derive the descriptions and image from the post in question (101 in this example).
and if there's no image in post 101, the fallback sequence would be: post 101 > first post of topic 20 > default overall site image

not a very important feature, but if you're looking for things to add, i think it would be cool.

https://www.phpbb.com/customise/db/extension/seo_metadata/support/topic/208701

Infinite loading - timeout

I've found a bug that prevent topic from displaying.

Steps to reproduce:

  1. Create a topic and put an image from external website that keeps loading forever (returns timeout). E.g sample
  2. Turn on seo metadata extension
  3. Go to the previously created topic

Result: phpbb3 also returns timeout. ๐Ÿ˜ข

There would be nice to have a feature that is trying to check out image dimensions only for like 2 or 3 seconds and give up if it doesn't work.

SVG logo is not accepted

When trying to use a svg for the JSON-LD publisher logo, the following message is received:
Invalid values for fields: Publisher logo

<meta property="og:image*> is sometimes missing on some HTTPS sites

This extension uses FastImageSize->getImageSize(), which in its turn calls @file_get_contents(), which silently fails with an SSL error "SSL operation failed with code 1..." As a result, og:image tags disappear without a trace. This doesn't happen on every server and probably depends on server config. The problem is that you use the full absolute URLs (https://etc) for local images when performing local routines like checking image dimensions etc. Please 1) make URLs absolite only in the last step, when sending them to template; 2) write to the error log when attachments that certainly exist cannot be obtained for some reason.

Example:

file_get_contents('./image.png'); // OK
file_get_contents('https://site.com/image.png'); // Fail

Refs:
Typical related discussion:
https://stackoverflow.com/questions/26148701/file-get-contents-ssl-operation-failed-with-code-1-failed-to-enable-crypto
PHPBB bugreport:
https://tracker.phpbb.com/browse/PHPBB3-16742
FastImageSize bugreport:
marc1706/fast-image-size#61

helper#extract_image() does not match images with query string in the URL

helper#extract_image() does not match images containing a query string in their URL. For example the following image will be ignore due to \.(?:jpe?g|png|gif)$ looking for the file extension to be the last thing in the URL: <img src="www.example.com/my-image.jpg?h=400&w=500" alt="" />.

Query strings in images src is useful when dealing with dynamically sized images and/or caching mechanisms that rely on URL params for cache expiration, so this might be something you want to consider for this extension.

It throws warnings when open_basedir is set

\phpbb\filesystem\filesystem::resolve_path() (called from \phpbb\filesystem\filesystem::realpath()) throws the following warnings when calling is_link(), is_dir() or is_file() on the server root directory, which is usually excluded (for security reasons) from the open_basedir directive.

It doesn't seems to be a bug of this extension but from phpBB's filesystem class.

https://tracker.phpbb.com/browse/PHPBB3-15643

Warning in helper::extract_image()

The pull request #45, part of the reseased version 1.3.0, re-introduced a similar bug to #39 in the helper::extract_image() that gives the following warning.

[phpBB Debug] PHP Notice: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 126: Trying to access array offset on value of type null

Error update to 1.1.0

Use ext version 1.0.0

I have Disable -> Delete data -> Delete all the files inside {PHPBB_ROOT}/ext/alfredoramos/seometadata/ -> Download on: https://github.com/AlfredoRamos/phpbb-ext-seo-metadata/releases/tag/1.1.0 -> upload & extract -> enable ext & have error

image

`Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.

A module already exists: ACP_SEO_METADATA`

Can you help me?

twitter card not completely extracted

Hi,
Compliment for your work!
Works fine, but i not understand why not extract twitter card
Extract only

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@homekititalia1">

but
tag <meta name="twitter:image"> not displayed.
tag <meta name="twitter:title"> not displayed.
tag <meta name="twitter:description"> not displayed.
i'm using version 1.2.0-beta2

Image extraction doesn't always return an array

sorry for the low quality of this bug report. i'm just passing along information as i get it.

phpBB 3.2.8
php (fpm) 7.2.24
postgresql 9.6.15
SEO Metadata 1.2.0

a user sent me these error messages

[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 146: Illegal string offset 'url'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 146: Illegal string offset 'url'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 146: Cannot assign an empty string to a string offset
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 159: Illegal string offset 'url'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 165: Illegal string offset 'url'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 166: Illegal string offset 'type'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 167: Illegal string offset 'width'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 168: Illegal string offset 'height'
[phpBB Debug] PHP Warning: in file [ROOT]/ext/alfredoramos/seometadata/event/listener.php on line 176: Illegal string offset 'url'

i have no idea what he was doing when he got that error. i'm trying to get more info out of him.
i can also try to look in logs if you're curious. not sure where to look though.

https://www.phpbb.com/customise/db/extension/seo_metadata/support/topic/209426

Does upgrade require complete uninstall? (bug or feat. request)

Hi,

does upgrading from a previous version requires:

  1. a complete uninstall (including deleting its data, that is the configuration) or

  2. is it enough to disable the extension, delete the files under /forum/ext/ , replace them with the new version and then enable the extension again, without the need to delete data and thus re-enter the config from scratch?

If it's true the former (1), take this as a feature request: if possible, please avoid that need, as having to re-enter the config at every update is quite inconvenient.

OTOH, if it's true the latter (2) then there's a bug in the README.md file, as in the upgrade instructions it states "Uninstall the extension" rather then "Disable the extension".

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.